smile.taxonomy
Class Taxonomy
- java.lang.Object
-
- smile.taxonomy.Taxonomy
-
public class Taxonomy extends java.lang.ObjectA taxonomy is a tree of terms (aka concept) where leaves must be named but intermediary nodes can be anonymous.
-
-
Constructor Summary
Constructors Constructor and Description Taxonomy()Constructor.Taxonomy(java.lang.String rootConcept)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ConceptgetConcept(java.lang.String keyword)Returns a concept node which synset contains the keyword.java.util.List<java.lang.String>getConcepts()Returns all named concepts from this taxonomyConceptgetRoot()Returns the root node of taxonomy tree.ConceptlowestCommonAncestor(Concept v, Concept w)Returns the lowest common ancestor (LCA) of concepts v and w.ConceptlowestCommonAncestor(java.lang.String v, java.lang.String w)Returns the lowest common ancestor (LCA) of concepts v and w.
-
-
-
Constructor Detail
-
Taxonomy
public Taxonomy()
Constructor.
-
Taxonomy
public Taxonomy(java.lang.String rootConcept)
Constructor.- Parameters:
rootConcept- the keyword of root concept.
-
-
Method Detail
-
getRoot
public Concept getRoot()
Returns the root node of taxonomy tree.- Returns:
- root node.
-
getConcept
public Concept getConcept(java.lang.String keyword)
Returns a concept node which synset contains the keyword.
-
getConcepts
public java.util.List<java.lang.String> getConcepts()
Returns all named concepts from this taxonomy
-
lowestCommonAncestor
public Concept lowestCommonAncestor(java.lang.String v, java.lang.String w)
Returns the lowest common ancestor (LCA) of concepts v and w. The lowest common ancestor is defined between two nodes v and w as the lowest node that has both v and w as descendants (where we allow a node to be a descendant of itself).
-
lowestCommonAncestor
public Concept lowestCommonAncestor(Concept v, Concept w)
Returns the lowest common ancestor (LCA) of concepts v and w. The lowest common ancestor is defined between two nodes v and w as the lowest node that has both v and w as descendants (where we allow a node to be a descendant of itself).
-
-
DataMelt 3.0 © DataMelt by jWork.ORG