eta.util.ulf.lex

Functions for converting lexemes into ULF symbols.

Relies on the NLTK Snowball stemmer.

Functions

stem_superlative

Find stem of a superlative adjective.

to_ulf

Convert a word to a ULF of a given type category.

to_ulf(cat, word)[source]

Convert a word to a ULF of a given type category.

This version is incomplete and intended for very limited experimental use.

Parameters:
  • cat (str) – The ULF type category to generate (e.g., name, v, or p).

  • word (str) – The word to lexicalize (e.g., mercedes, are, or on-top-of).

Returns:

The generated ULF.

Return type:

s-expr

stem_superlative(sup_adv)[source]

Find stem of a superlative adjective.

This is a stub, intended as default when word-specific stems have not been found in the calling program only a simple check whether the stem probably shouldn’t have a doubled up final consonant is made.

Parameters:

sup-adj (str) – An upper-case symbolic atom such as biggest, smartest, etc.

Returns:

The stemmed superlative.

Return type:

str