pepper.language.analyzers module

pepper.language.analyzers.analyze_np(np_list, speaker)

This function analyzes a noun phrase (consists of pronouns, nouns, names, or possessive pronouns + prepositions) Morphological information which is stored in pronouns is extracted, names are simply marked as ‘human’ and possessive syntax constructions are analyzed

pepper.language.analyzers.analyze_possessive_np(poss, np_list)

This function is called to analyze possessive constructions like “my name” It extracts the person who is possessing and what does the person possess - the category in this case would be “name” and the person possessing is the speaker The predicate is created by adding a suffix “-is” to the category e.g. “name-is”

pepper.language.analyzers.analyze_pronoun(pronoun, speaker)

This function returns a morphology which it reads from the grammar (grammar.json) The grammar has information about person (1st, 2nd, 3rd) and number (singular or plural) for regular and possessive pronouns

pepper.language.analyzers.analyze_question_word(question_word, pos)

This function returns the response type of a question based on its first word

pepper.language.analyzers.analyze_verb(verb)

This function is called when a verb is detected, it can be either the verb to be or one of the verbs from the predicate list

pepper.language.analyzers.analyze_verb_question(words, speaker, viewed_objects)

This function analyzes questions which start with a verb to be or a modal verb

pepper.language.analyzers.analyze_wh_question(words, speaker, response_type, viewed_object)

This function analyzes questions which start with who, what, where (why and when are also in this category but are not yet comprehended by Leolani)

pepper.language.analyzers.extract_named_entities(np_list)

Using the Stanford NER package, this function tries to extract named entities such as persons, locations, organizations etc.