Package edu.stanford.nlp.dcoref
Class Dictionaries
- java.lang.Object
-
- edu.stanford.nlp.dcoref.Dictionaries
-
public class Dictionaries extends Object
Provides accessors for various grammatical, semantic, and world knowledge lexicons and word lists primarily used by the Sieve coreference system, but sometimes also drawn on from other code. The source of the dictionaries on Stanford NLP machines is /u/nlp/data/coref/gazetteers/dcoref/ . In models jars, they live in edu/stanford/nlp/models/dcoref .
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDictionaries.Animacystatic classDictionaries.Genderstatic classDictionaries.MentionTypestatic classDictionaries.Numberstatic classDictionaries.Person
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Dictionaries()Dictionaries(String demonymWords, String animateWords, String inanimateWords, String maleWords, String neutralWords, String femaleWords, String pluralWords, String singularWords, String statesWords, String genderNumber, String countries, String states, boolean loadCorefDict, String[] corefDictFiles, String corefDictPMIFile, String signaturesFile)Dictionaries(Properties props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getDemonyms(String name)Returns a set of demonyms for a country (or city or region).booleanisAdjectivalDemonym(String token)Returns whether this mention (possibly multi-word) is the adjectival form of a demonym, like "African" or "Iraqi".voidloadStateAbbreviation(String statesFile)The format of each line of this file is fullStateName ( TAB abbrev )* The file is cased and checked cased.StringlookupCanonicalAmericanStateName(String name)If the input string is an abbreviation of a U.S.static Stringsignature(Properties props)
-
-
-
Field Detail
-
genderNumber
public final Map<List<String>,Dictionaries.Gender> genderNumber
-
-
Constructor Detail
-
Dictionaries
public Dictionaries(Properties props)
-
Dictionaries
public Dictionaries(String demonymWords, String animateWords, String inanimateWords, String maleWords, String neutralWords, String femaleWords, String pluralWords, String singularWords, String statesWords, String genderNumber, String countries, String states, boolean loadCorefDict, String[] corefDictFiles, String corefDictPMIFile, String signaturesFile)
-
Dictionaries
public Dictionaries()
-
-
Method Detail
-
loadStateAbbreviation
public void loadStateAbbreviation(String statesFile)
The format of each line of this file is fullStateName ( TAB abbrev )* The file is cased and checked cased. The result is: statesAbbreviation is a hash from each abbrev to the fullStateName.
-
lookupCanonicalAmericanStateName
public String lookupCanonicalAmericanStateName(String name)
If the input string is an abbreviation of a U.S. state name or the canonical name, the canonical name is returned. Otherwise, null is returned.- Parameters:
name- Is treated as a cased string. ME != me
-
getDemonyms
public Set<String> getDemonyms(String name)
Returns a set of demonyms for a country (or city or region).- Parameters:
name- Some string perhaps a country name like "Australia"- Returns:
- A Set of demonym Strings, perhaps { "Australian", "Aussie", "Aussies" }. If none are known (including if the argument isn't a country/region name, then the empty set will be returned.
-
isAdjectivalDemonym
public boolean isAdjectivalDemonym(String token)
Returns whether this mention (possibly multi-word) is the adjectival form of a demonym, like "African" or "Iraqi". True if it is an adjectival form, even if also a name for a person of that country (such as "Iraqi").
-
signature
public static String signature(Properties props)
-
-