Tutorial > Analyzing Text

Phonemes

A phoneme is a single "unit" of sound that has meaning in any language. Each phoneme represents a different sound a person can make. Since there are only 26 letters in the alphabet (and about 40 phonemes), sometimes letter combinations are used to make a phoneme. Here is an example:

chef = /ʃef/
choir = /kwaɪə/
cheese = /tʃi:z/

The "ch" letter combination has three different pronunciations, which are represented by three different phonemes: /ʃ/, /k/ and /tʃ/.

In RiTa, we use Arpabet to represent the phonemes. Arpabet is a phonetic transcription code developed by Advanced Research Projects Agency (ARPA) as a part of the Speech Understanding Project. It represents each phoneme of English with a distinct sequence of ASCII characters.

The above example would be translated like this if we use Arpabet:

chef = ch eh f
choir = k w ay r
cheese = ch iy z

You can use RiTa.getPhonemes to analyse the phonemes.

RiTa.getPhonemes("An elephant is a mammal");

It will return: 'ae-n eh-l-ax-f-ax-n-t ih-z ey m-ae-m-ax-l'.


A list of the phonemes used in RiTa:
http://www.rednoise.org/rita/reference/PhonemeTags.php

The reference list from Arpabet to IPA:
https://en.wikipedia.org/wiki/Arpabet


Stresses

In phonetics, stress refers to the degree of emphasis given to a sound or syllable in speech, resulting in relative loudness. This is also sometimes called lexical stress or word stress.

RiTa.getStresses analyzes text and returns a new string containing the stress for each syllable of the input.

RiTa.getStresses("computer");

In this case, it returns 0/1/0, with a 1 meaning 'stressed', and 0 means ‘unstressed’: e.g., com-PUTE-er


POS (Part of speech)

Each part-of-speech is a category of words which have similar grammatical properties. Words that are assigned to the same part-of-speech play similar roles within the structure of sentences. Commonly used English parts of speech are noun, verb, adjective, adverb, pronoun, preposition, conjunction, article, etc.

You can use RiTa.getPosTags to analyze the part-of-speech (or POS) for you.

RiTa.getPosTags("I am hungry");

The outcome would be: ["prp", "vbp", "jj"]

Here you can find a reference list of PENN part-of-speech tagger in RiTa.

By default RiTa uses the PENN tag set and it is very detailed. If you only need the very basic POS categories, you can switch to WordNet-style tags, which covers just the following basic categories:

n -> NOUN
v -> VERB
a -> ADJECTIVE
r -> ADVERB