public class MetaBagOfWords extends BagOfWords
bagOfWords, name, wordOrder
Constructor and Description |
---|
MetaBagOfWords()
Create a new instance of MetaBagOfWords
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyOther(MetaBagOfWords copyFrom)
Copy the other fields in the parameter passed in to this bag of words.
|
BagOfWords |
difference(BagOfWords thisBagOfWords)
Create a new bag of words that is the difference between of this one and
the one passed in.
|
float |
dotproduct(BagOfWords thisBagOfWords)
Calculate the dotproduct value of this bag-of-words with the one passed in.
|
float |
dotproductOther(BagOfWords thisBagOfWords)
Update this bag of words with dotproduct of the 'other' fields from
the parameter passed in.
|
java.lang.String |
getDirection()
Get the movement direction.
|
static java.lang.String |
getDirectionUnion(java.lang.String direction1,
java.lang.String direction2)
Get the combination of the two directions.
|
int |
getItemCount()
Get a count of all items in the bag.
|
int |
getTotalItemCount()
Get a count of all items in the bag.
|
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
getTypeSet()
Get the words type sets.
|
BagOfWords |
intersection(BagOfWords thisBagOfWords)
Create a new bag of words that is the intersection of this one with
the one passed in.
|
protected void |
intersectionOther(MetaBagOfWords intersectWith)
Update this bag of words with intersections of the 'other' fields from
the parameter passed in.
|
float |
magnitude(BagOfWords thisBagOfWords)
Calculate the magnitude value of this bag-of-words with the one passed in.
|
float |
magnitudeOther(BagOfWords thisBagOfWords)
Update this bag of words with magnitude of the 'other' fields from
the parameter passed in.
|
boolean |
otherIsSame(MetaBagOfWords compareWith)
Compare the other metadata with this bag-of-words metadata and return true
if they are the same.
|
void |
setDirection(java.lang.String thisDirection)
Set the movement direction.
|
boolean |
setTypeSet(java.lang.String theWord,
java.util.ArrayList<java.lang.String> wordTypes)
Set the type set for the specified word.
|
BagOfWords |
subtract(BagOfWords thisBagOfWords)
Create a new bag of words that is the subtraction of the bag passed in from
this one.
|
org.licas_xml.abs.Element |
toXml()
Convert this bag of words into an XML format.
|
BagOfWords |
union(BagOfWords thisBagOfWords)
Create a new bag of words that is the union of this one with
the one passed in.
|
protected void |
unionOther(MetaBagOfWords unionWith)
Update this bag of words with unions of the 'other' fields from the parameter
passed in.
|
createBagOfWords, createBagOfWords, getBagOfWords, getName, getTotalWordCount, getWordOrder, orderBagOfWords, removeWords, sameWordList, setBagOfWords, setBagOfWords, setName
public boolean setTypeSet(java.lang.String theWord, java.util.ArrayList<java.lang.String> wordTypes)
theWord
- the parsed word name.wordTypes
- a list of word types, of type TextConst.NOUN, VERB, ADJECTIVE, ADVERB
.public BagOfWords subtract(BagOfWords thisBagOfWords) throws java.lang.Exception
subtract
in class BagOfWords
thisBagOfWords
- the bag of words to intersect with.java.lang.Exception
- any error.public BagOfWords difference(BagOfWords thisBagOfWords) throws java.lang.Exception
difference
in class BagOfWords
thisBagOfWords
- the bag of words to intersect with.java.lang.Exception
- any error.public BagOfWords intersection(BagOfWords thisBagOfWords) throws java.lang.Exception
intersection
in class BagOfWords
thisBagOfWords
- the bag of words to intersect with.java.lang.Exception
- any error.public BagOfWords union(BagOfWords thisBagOfWords) throws java.lang.Exception
union
in class BagOfWords
thisBagOfWords
- the bag of words to intersect with.java.lang.Exception
- any error.public float dotproduct(BagOfWords thisBagOfWords)
dotproduct
in class BagOfWords
thisBagOfWords
- the bag of words to combine with.public float dotproductOther(BagOfWords thisBagOfWords)
thisBagOfWords
- the bag of words to combine with.public float magnitude(BagOfWords thisBagOfWords)
magnitude
in class BagOfWords
thisBagOfWords
- the bag of words to combine with.public float magnitudeOther(BagOfWords thisBagOfWords)
thisBagOfWords
- the bag of words to combine with.protected void copyOther(MetaBagOfWords copyFrom)
copyFrom
- the bag of words to copy from.public boolean otherIsSame(MetaBagOfWords compareWith)
compareWith
- the meta bag-of-words to compare with.protected void intersectionOther(MetaBagOfWords intersectWith)
intersectWith
- the second bag of words to intersect with.protected void unionOther(MetaBagOfWords unionWith)
unionWith
- the second bag of words to combine with.public int getItemCount()
public int getTotalItemCount()
public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getTypeSet()
public void setDirection(java.lang.String thisDirection)
thisDirection
- the direction - N, S, NE, etc.public java.lang.String getDirection()
public org.licas_xml.abs.Element toXml() throws java.lang.Exception
toXml
in class BagOfWords
java.lang.Exception
- any error.public static java.lang.String getDirectionUnion(java.lang.String direction1, java.lang.String direction2)
direction1
- the first direction.direction2
- the second direction.