Documentation of 'smile.nlp.SimpleText' Java class
SimpleText
smile.nlp

Class SimpleText

    • Constructor Summary

      Constructors 
      Constructor and Description
      SimpleText(java.lang.String id, java.lang.String title, java.lang.String body, java.lang.String[] words)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      SimpleText addAnchor(java.lang.String linkLabel)
      Add a link label to the anchor text.
      boolean equals(java.lang.Object obj) 
      java.lang.String getAnchor()
      Returns the anchor text if any.
      int hashCode() 
      int maxtf()
      Returns the maximum term frequency over all terms in the document.
      SimpleText setAnchor(java.lang.String anchor)
      Sets the anchor text.
      int size()
      Returns the number of words.
      int tf(java.lang.String term)
      Returns the term frequency.
      java.lang.String toString() 
      java.lang.Iterable<java.lang.String> unique()
      Returns the iterator of unique words.
      java.lang.Iterable<java.lang.String> words()
      Returns the iterator of the words of the document.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleText

        public SimpleText(java.lang.String id,
                          java.lang.String title,
                          java.lang.String body,
                          java.lang.String[] words)
        Constructor.
        Parameters:
        id - the id of document.
        words - the word list of document.
    • Method Detail

      • size

        public int size()
        Description copied from interface: TextTerms
        Returns the number of words.
        Specified by:
        size in interface TextTerms
      • words

        public java.lang.Iterable<java.lang.String> words()
        Description copied from interface: TextTerms
        Returns the iterator of the words of the document. The stop words and punctuations may be removed.
        Specified by:
        words in interface TextTerms
      • unique

        public java.lang.Iterable<java.lang.String> unique()
        Description copied from interface: TextTerms
        Returns the iterator of unique words.
        Specified by:
        unique in interface TextTerms
      • tf

        public int tf(java.lang.String term)
        Description copied from interface: TextTerms
        Returns the term frequency.
        Specified by:
        tf in interface TextTerms
      • maxtf

        public int maxtf()
        Description copied from interface: TextTerms
        Returns the maximum term frequency over all terms in the document.
        Specified by:
        maxtf in interface TextTerms
      • getAnchor

        public java.lang.String getAnchor()
        Returns the anchor text if any. The anchor text is the visible, clickable text in a hyperlink. The anchor text is all the anchor text in the corpus pointing to this text.
        Specified by:
        getAnchor in interface AnchorText
      • setAnchor

        public SimpleText setAnchor(java.lang.String anchor)
        Sets the anchor text. Note that anchor is all link labels in the corpus pointing to this text. So addAnchor is more appropriate in most cases.
        Specified by:
        setAnchor in interface AnchorText
      • addAnchor

        public SimpleText addAnchor(java.lang.String linkLabel)
        Description copied from interface: AnchorText
        Add a link label to the anchor text.
        Specified by:
        addAnchor in interface AnchorText
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.