|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javatools.parsers.NounGroup
public class NounGroup
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools).
It is licensed under the Creative Commons Attribution License
(see http://creativecommons.org/licenses/by/3.0) by
the YAGO-NAGA team (see http://mpii.de/yago-naga).
The class NounGroup splits a noun group (given by a String) into its
modifiers and its head.
Example:
System.out.println(new NounGroup("the United States of America").description()); -> NounGroup: Original: the_United_States_of_America Determiner: the Head: State Plural: true preModifiers: United Adjective: Preposition: of postModifier: NounGroup: Original: America Determiner: Head: America Plural: false preModifiers: Preposition: postModifier:
Nested Class Summary | |
---|---|
static interface |
NounGroup.String2Boolean
Defines just one function from a String to a boolean |
Field Summary | |
---|---|
static java.util.Set<java.lang.String> |
determiners
Contains determiners |
static NounGroup.String2Boolean |
isAdjective
Tells whether a word is an adjective (currently by a simple heuristics |
static FinalSet<java.lang.String> |
prepositions
Holds prepositions (like "of" etc.) |
Constructor Summary | |
---|---|
NounGroup(java.util.List<java.lang.String> words)
Constructs a noun group from a list of words |
|
NounGroup(java.lang.String s)
Constructs a noun group from a String |
Method Summary | |
---|---|
java.lang.String |
adjective()
Returns the adjective. |
java.lang.String |
description()
Returns all fields in a String |
java.lang.String |
determiner()
Returns the determiner. |
boolean |
equals(java.lang.Object o)
Checks if the originals match |
java.lang.String |
head()
Returns the head (lowercased singular). |
static void |
main(java.lang.String[] args)
Test method |
java.lang.String |
original()
Returns the original. |
NounGroup |
postModifier()
Returns the postModifier. |
java.lang.String |
preModifier()
Returns the preModifier. |
java.lang.String |
preposition()
Returns the preposition. |
boolean |
stemHead()
Stems the head. |
java.lang.String |
stemmed()
Returns the full name with the head word stemmed |
java.lang.String |
toString()
Returns the original |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static NounGroup.String2Boolean isAdjective
public static final java.util.Set<java.lang.String> determiners
public static final FinalSet<java.lang.String> prepositions
Constructor Detail |
---|
public NounGroup(java.lang.String s)
public NounGroup(java.util.List<java.lang.String> words)
Method Detail |
---|
public java.lang.String adjective()
public java.lang.String determiner()
public java.lang.String head()
public java.lang.String original()
public NounGroup postModifier()
public java.lang.String preModifier()
public java.lang.String preposition()
public java.lang.String stemmed()
public boolean stemHead()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String description()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |