Class Phrase

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

public class Phrase extends Object implements Serializable
Represents a phrase—a group of words that function together as a single syntactic unit within a sentence but do not necessarily contain a subject and a predicate (clause). * @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Phrase

      public Phrase()
      Initializes an empty phrase.
    • Phrase

      public Phrase(List<Word> words)
      Initializes a phrase from an ordered list of words.
      Parameters:
      words - constituent words
    • Phrase

      public Phrase(String text, Language language)
      Initializes a phrase by parsing a raw text string.
      Parameters:
      text - the textual phrase
      language - the language for the constituent words
  • Method Details

    • getWords

      public List<Word> getWords()
      Returns:
      unmodifiable list of the phrase's constituent words
    • addWord

      public void addWord(Word word)
      Appends a word to the end of the phrase.
      Parameters:
      word - word to add
    • getType

      public Phrase.Type getType()
    • setType

      public void setType(Phrase.Type type)
    • getWordCount

      public int getWordCount()
      Returns:
      total count of words in the phrase
    • getHead

      public Word getHead()
      Returns:
      the primary 'head' word of the phrase (simplified as the last word)
    • toString

      public String toString()
      Overrides:
      toString in class Object