Skip navigation links
edu.illinois.cs.cogcomp.lbjava.nlp

Class Word

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      boolean capitalized
      Whether or not the word is capitalized is determined automatically by the constructor.
      String form
      The actual text from the corpus that represents the word.
      String lemma
      The base form of the word.
      String partOfSpeech
      Names the part of speech of this word.
      String wordSense
      An indication of the meaning or usage of this instance of this word.
      • Fields inherited from class edu.illinois.cs.cogcomp.lbjava.parse.LinkedChild

        end, label, next, parent, previous, start
    • Constructor Summary

      Constructors 
      Constructor and Description
      Word(String f)
      When all that is known is the spelling of the word.
      Word(String f, int start, int end)
      When you have offset information.
      Word(String f, String pos)
      Sets the actual text and the part of speech.
      Word(String f, String pos, int start, int end)
      When you have offset information.
      Word(String f, String pos, String l, String sense, Word p, int start, int end)
      This constructor is useful when the sentence is being parsed forwards.
      Word(String f, String pos, Word p)
      This constructor is useful when the sentence is being parsed forwards.
      Word(String f, String pos, Word p, int start, int end)
      This constructor is useful when the sentence is being parsed forwards.
      Word(String f, Word p)
      This constructor is useful when the sentence is being parsed forwards.
      Word(String f, Word p, int start, int end)
      This constructor is useful when the sentence is being parsed forwards.
    • Field Detail

      • form

        public String form
        The actual text from the corpus that represents the word.
      • capitalized

        public boolean capitalized
        Whether or not the word is capitalized is determined automatically by the constructor.
      • partOfSpeech

        public String partOfSpeech
        Names the part of speech of this word.
      • lemma

        public String lemma
        The base form of the word.
      • wordSense

        public String wordSense
        An indication of the meaning or usage of this instance of this word.
    • Constructor Detail

      • Word

        public Word(String f)
        When all that is known is the spelling of the word.
        Parameters:
        f - The actual text of the word.
      • Word

        public Word(String f,
                    String pos)
        Sets the actual text and the part of speech.
        Parameters:
        f - The actual text of the word.
        pos - A token representing the word's part of speech.
      • Word

        public Word(String f,
                    Word p)
        This constructor is useful when the sentence is being parsed forwards.
        Parameters:
        f - The actual text of the word.
        p - The word that came before this one in the sentence.
      • Word

        public Word(String f,
                    String pos,
                    Word p)
        This constructor is useful when the sentence is being parsed forwards.
        Parameters:
        f - The actual text of the word.
        pos - A token representing the word's part of speech.
        p - The word that came before this one in the sentence.
      • Word

        public Word(String f,
                    int start,
                    int end)
        When you have offset information.
        Parameters:
        f - The actual text of the word.
        start - The offset into the parent document at which the first character of this word is found.
        end - The offset into the parent document at which the last character of this word is found.
      • Word

        public Word(String f,
                    String pos,
                    int start,
                    int end)
        When you have offset information.
        Parameters:
        f - The actual text of the word.
        pos - A token representing the word's part of speech.
        start - The offset into the parent document at which the first character of this word is found.
        end - The offset into the parent document at which the last character of this word is found.
      • Word

        public Word(String f,
                    Word p,
                    int start,
                    int end)
        This constructor is useful when the sentence is being parsed forwards.
        Parameters:
        f - The actual text of the word.
        p - The word that came before this one in the sentence.
        start - The offset into the parent document at which the first character of this word is found.
        end - The offset into the parent document at which the last character of this word is found.
      • Word

        public Word(String f,
                    String pos,
                    Word p,
                    int start,
                    int end)
        This constructor is useful when the sentence is being parsed forwards.
        Parameters:
        f - The actual text of the word.
        pos - A token representing the word's part of speech.
        p - The word that came before this one in the sentence.
        start - The offset into the parent document at which the first character of this word is found.
        end - The offset into the parent document at which the last character of this word is found.
      • Word

        public Word(String f,
                    String pos,
                    String l,
                    String sense,
                    Word p,
                    int start,
                    int end)
        This constructor is useful when the sentence is being parsed forwards.
        Parameters:
        f - The actual text of the word.
        pos - A token representing the word's part of speech.
        l - The base form of the word.
        sense - The sense of the word.
        p - The word that came before this one in the sentence.
        start - The offset into the parent document at which the first character of this word is found.
        end - The offset into the parent document at which the last character of this word is found.
    • Method Detail

      • toString

        public String toString()
        The string representation of a word is its POS bracket form, or, if the part of speech is not available, it is just the spelling of the word. Note that the POS bracket form of a word also entails displaying left brackets ("(", "[", and "{") as "-LRB-" and right brackets (")", "]", "}") as "-RRB-".
        Overrides:
        toString in class Object
        Returns:
        The POS bracket form of this word, or just the spelling of the word if the part of speech is not available.

Copyright © 2017. All rights reserved.