public class NounGroup extends Object
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:
| Modifier and Type | Class and Description |
|---|---|
static interface |
NounGroup.String2Boolean
Defines just one function from a String to a boolean
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
adjective
Holds the adjective
|
protected String |
determiner
Holds the determiner (if any)
|
static Set<String> |
determiners
Contains determiners
|
protected String |
head
Holds the head of the noun group
|
static NounGroup.String2Boolean |
isAdjective
Tells whether a word is an adjective (currently by a simple heuristics
|
protected String |
original
Holds the original noun group
|
protected NounGroup |
postModifier
Holds the noun group after the preposition
|
protected String |
preModifier
Holds the modifiers before the head
|
protected String |
preposition
Holds the preposition
|
static FinalSet<String> |
prepositions
Holds prepositions (like "of" etc.)
|
| Constructor and Description |
|---|
NounGroup(List<String> words)
Constructs a noun group from a list of words
|
NounGroup(String s)
Constructs a noun group from a String
|
| Modifier and Type | Method and Description |
|---|---|
String |
adjective()
Returns the adjective.
|
String |
description()
Returns all fields in a String
|
String |
determiner()
Returns the determiner.
|
boolean |
equals(Object o)
Checks if the originals match
|
String |
head()
Returns the head (lowercased singular).
|
static void |
main(String[] args)
Test method
|
String |
original()
Returns the original.
|
NounGroup |
postModifier()
Returns the postModifier.
|
String |
preModifier()
Returns the preModifier.
|
String |
preposition()
Returns the preposition.
|
boolean |
stemHead()
Stems the head.
|
String |
stemmed()
Returns the full name with the head word stemmed
|
String |
toString()
Returns the original
|
public static NounGroup.String2Boolean isAdjective
protected String original
protected String adjective
protected String preposition
protected NounGroup postModifier
protected String head
protected String preModifier
protected String determiner
public NounGroup(String s)
public String adjective()
public String determiner()
public String head()
public String original()
public NounGroup postModifier()
public String preModifier()
public String preposition()
public String stemmed()
public boolean stemHead()
public boolean equals(Object o)
public String description()
Copyright © 2018. All rights reserved.