Class Concept
java.lang.Object
smile.taxonomy.Concept
Concept is a set of synonyms, i.e. group of words that are roughly
synonymous in a given context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a child to this node.voidAdds a child to this node.voidaddKeywords(String... keywords) Adds a list of synomym to the concept synset.children()Gets all children concepts.Returns the path from root to this node.Returns the path from this node to the root.booleanisAncestorOf(Concept concept) Returns true if this concept is an ancestor of the given concept.booleanisLeaf()Check if a node is a leaf in the taxonomy tree.keywords()Returns the concept synonym set.booleanremoveChild(Concept concept) Removes a child to this node.voidremoveKeyword(String keyword) Removes a keyword from the concept synset.toString()
-
Constructor Details
-
Concept
-
-
Method Details
-
isLeaf
public boolean isLeaf()Check if a node is a leaf in the taxonomy tree.- Returns:
- true if a node is a leaf.
-
keywords
-
addKeywords
Adds a list of synomym to the concept synset.- Parameters:
keywords- the synomyms.
-
removeKeyword
Removes a keyword from the concept synset.- Parameters:
keyword- the keyword.
-
children
-
addChild
-
addChild
-
removeChild
Removes a child to this node.- Parameters:
concept- the concept.- Returns:
- true if the given concept is a child.
-
isAncestorOf
Returns true if this concept is an ancestor of the given concept.- Parameters:
concept- the concept.- Returns:
- true if this concept is an ancestor of the given concept.
-
getPathFromRoot
-
getPathToRoot
-
toString
-