Class Lexeme

java.lang.Object
org.episteme.social.linguistics.Lexeme
All Implemented Interfaces:
Serializable

public class Lexeme extends Object implements Serializable
Represents a lexeme—an abstract unit of the lexicon in a language that encompasses all inflected forms of a single word. For example, the lexeme 'run' includes the forms 'run', 'runs', 'ran', and 'running'. * @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Lexeme

      public Lexeme(String canonicalForm, Language language)
      Constructs a lexeme with a canonical form.
      Parameters:
      canonicalForm - the dictionary form (lemma) of the lexeme
      language - the language of the lexeme
    • Lexeme

      public Lexeme(List<Word> forms)
      Constructs a lexeme from an existing set of word forms.
      Parameters:
      forms - list of word forms belonging to this lexeme
      Throws:
      IllegalArgumentException - if forms is null or empty
  • Method Details

    • getLanguage

      public Language getLanguage()
      Returns:
      the primary language associated with this lexeme
    • getForms

      public List<Word> getForms()
      Returns:
      unmodifiable list of current morphological forms
    • addForm

      public void addForm(Word form)
      Adds an inflected form to the lexeme.
      Parameters:
      form - the word form to add
    • getCanonicalForm

      public String getCanonicalForm()
      Returns:
      the lemma or base form of the lexeme
    • setCanonicalForm

      public void setCanonicalForm(String canonicalForm)
    • getPartOfSpeech

      public Word.PartOfSpeech getPartOfSpeech()
    • setPartOfSpeech

      public void setPartOfSpeech(Word.PartOfSpeech pos)
    • getDefinition

      public String getDefinition()
    • setDefinition

      public void setDefinition(String definition)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object