public class TermMapping
extends Object
Modifier and Type | Field and Description |
---|---|
(package private) Properties |
alternatives |
(package private) Properties |
plurals |
(package private) Properties |
prefixes |
(package private) Properties |
suffixes |
(package private) Properties |
types |
Constructor and Description |
---|
TermMapping(String language) |
Modifier and Type | Method and Description |
---|---|
String |
alt(String key)
Looks up alternative words for purposes of creating natural language.
|
String |
alt(String key,
int cardinality)
Looks up alternative words for purposes of creating natural language.
|
String |
cardinalize(String s,
int cardinality)
Handles singular/plural issues for terms.
|
String |
prefix(String relationlabel,
boolean isActor)
Determines a word or phrase to precede a given relation.
|
private void |
putCombination(String original,
String prefix,
String alternative,
String suffix) |
private void |
setupAlternatives() |
private void |
setupCombinations()
For relations, these allow more natural sounding phrases to be
constructed.
|
private void |
setupEN() |
private void |
setupPlurals() |
private void |
setupPrefixes() |
private void |
setupSuffixes() |
private void |
setupTypes() |
String |
suffix(String relationlabel,
boolean isActor)
Determines a word or phrase to follow a given relation.
|
String |
type(String type)
Determines an alternative type label for certain labels.
|
Properties alternatives
Properties prefixes
Properties suffixes
Properties plurals
Properties types
public TermMapping(String language)
language
- an ISO abbreviation for the language desired. So far,
only "en" is supported. Volunteers are welcome for other languages.public String alt(String key, int cardinality)
key
- some term whose alternative form is sought.cardinality
- the quantity of the term being considered, especially
useful for distinguishing singular from plural.key
itself is returned.public String alt(String key)
key
- some term whose alternative form is sought.key
itself is returned.public String suffix(String relationlabel, boolean isActor)
relationlabel
- some relation whose appropriate suffix term is
sought.public String prefix(String relationlabel, boolean isActor)
relationlabel
- some relation whose appropriate suffix term is
sought.public String type(String type)
type
- some label whose appropriate type label is sought.public String cardinalize(String s, int cardinality)
s
- the term to be examinedcardinality
- the number of things to which the term applies.
Normally a 1 means singular, a number greater than one means plural.private void setupEN()
private void putCombination(String original, String prefix, String alternative, String suffix)
private void setupAlternatives()
private void setupSuffixes()
private void setupPrefixes()
private void setupPlurals()
private void setupTypes()
private void setupCombinations()