public abstract class LanguageDeclension extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LanguageDeclension.PluralNounForm
Simple noun form with singular and plurals
|
static class |
LanguageDeclension.SimpleAdjective
Represents a simple adjective with a single form.
|
static class |
LanguageDeclension.SimpleAdjectiveWithStartsWith
Represents a simple adjective for use in languages that have "startsWith" for articles and modifiers.
|
static class |
LanguageDeclension.SimpleModifierForm
SIMPLE FORMS:
Often times, complex declension have simple forms of one thing or another.
|
static class |
LanguageDeclension.SimplePluralNoun
Represents a simple noun with a singular and plural form.
|
| Constructor and Description |
|---|
LanguageDeclension(HumanLanguage language) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Adjective |
createAdjective(String name,
LanguageStartsWith startsWith,
LanguagePosition position) |
protected Article |
createArticle(String name,
LanguageArticle articleType) |
Noun |
createNoun(String name,
Noun.NounType type,
String entityName,
LanguageStartsWith startsWith,
LanguageGender gender,
Map<? extends NounForm,String> forms)
Accessor for creating custom nouns simply based on all of the forms.
|
Noun |
createNoun(String name,
Noun.NounType type,
String entityName,
ResultSet rs)
Helper method for creating a noun from the database
|
protected abstract Noun |
createNoun(String name,
String pluralAlias,
Noun.NounType type,
String entityName,
LanguageStartsWith startsWith,
LanguageGender gender,
String access,
boolean isStandardField,
boolean isCopied) |
protected static <K extends Enum<K>,V> |
enumMapFilterNulls(K k1,
V v1,
K k2,
V v2)
Create a new EnumMap with the given keys and values, only including an entry if the value and key are not null
This is used instead of ImmutableMap, because that doesn't allow null values
|
protected static <K extends Enum<K>,V> |
enumMapFilterNulls(K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
Create a new EnumMap with the given keys and values, only including an entry if the value and key are not null
This is used instead of ImmutableMap, because that doesn't allow null values
|
protected static <K extends Enum<K>,V> |
enumMapFilterNulls(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
Create a new EnumMap with the given keys and values, only including an entry if the value and key are not null
This is used instead of ImmutableMap, because that doesn't allow null values
|
String |
formLowercaseNounForm(String s,
NounForm form) |
AdjectiveForm |
getAdjectiveForm(AdjectiveForm af) |
AdjectiveForm |
getAdjectiveForm(LanguageStartsWith startsWith,
LanguageGender gender,
LanguageNumber number,
LanguageCase _case,
LanguageArticle article,
LanguagePossessive possessive) |
abstract List<? extends AdjectiveForm> |
getAdjectiveForms() |
abstract List<? extends NounForm> |
getAllNounForms() |
Set<LanguageArticle> |
getAllowedArticleTypes() |
EnumSet<LanguageCase> |
getAllowedCases() |
AdjectiveForm |
getApproximateAdjectiveForm(LanguageStartsWith startsWith,
LanguageGender gender,
LanguageNumber number,
LanguageCase _case,
LanguageArticle article,
LanguagePossessive possessive) |
ArticleForm |
getApproximateArticleForm(LanguageStartsWith startsWith,
LanguageGender gender,
LanguageNumber number,
LanguageCase _case) |
NounForm |
getApproximateNounForm(LanguageNumber number,
LanguageCase _case,
LanguagePossessive possessive,
LanguageArticle article) |
ArticleForm |
getArticleForm(ArticleForm af) |
ArticleForm |
getArticleForm(LanguageStartsWith startsWith,
LanguageGender gender,
LanguageNumber number,
LanguageCase _case) |
List<? extends ArticleForm> |
getArticleForms()
a
|
LanguagePosition |
getDefaultAdjectivePosition() |
LanguageArticle |
getDefaultArticle() |
LanguageCase |
getDefaultCase() |
LanguageGender |
getDefaultGender() |
LanguagePossessive |
getDefaultPossessive() |
LanguageStartsWith |
getDefaultStartsWith() |
abstract Collection<? extends NounForm> |
getEntityForms()
For entities, we need with-article forms, but validation method
will fix those values automatically.
|
NounForm |
getExactNounForm(LanguageNumber number,
LanguageCase _case,
LanguagePossessive possessive,
LanguageArticle article) |
abstract Collection<? extends NounForm> |
getFieldForms() |
HumanLanguage |
getLanguage() |
NounForm |
getNounForm(LanguageNumber number,
LanguageArticle articleType) |
NounForm |
getNounForm(LanguageNumber number,
LanguageCase caseType) |
NounForm |
getNounForm(NounForm nf) |
abstract Collection<? extends NounForm> |
getOtherForms() |
EnumSet<LanguageCase> |
getRequiredCases() |
EnumSet<LanguageGender> |
getRequiredGenders() |
EnumSet<LanguagePossessive> |
getRequiredPossessive() |
EnumSet<LanguageStartsWith> |
getRequiredStartsWith() |
boolean |
hasAllowedCases() |
boolean |
hasArticle() |
boolean |
hasArticleInNounForm() |
boolean |
hasAutoDerivedStartsWith()
Certain languages have strict rules for determining the starts with of an adjective, such as greek.
|
boolean |
hasCapitalization() |
abstract boolean |
hasGender()
Convenient method to tell that the language has gender.
In English, it is false. |
boolean |
hasPlural()
convenient method to tell that the language has plural form In English, it is true.
|
boolean |
hasPossessive()
convenient method to tell that the language has possessive form.
|
boolean |
hasPossessiveInAdjective() |
boolean |
hasRequiredCases() |
abstract boolean |
hasStartsWith()
convenient method to tell that the language has to know the noun, which starts with vowel (includes soft-sounds
like Hour).
|
boolean |
hasStartsWithInAdjective() |
boolean |
hasSubjectGenderInVerbConjugation()
This method is used to determine whether to display a "warning" in rename tabs about there being gramatical issues
around renaming gender
|
boolean |
isArticleInNounFormAutoDerived() |
boolean |
isInflected() |
boolean |
moveNounInflectionToFirstModifier()
Label file processing should change so that any modifier on a noun should move
from the noun to the first modifier, if one exists.
|
boolean |
shouldInferNounDefArticleFromParticle()
For languages where the noun has a different form based on the article (Nordic), should the
article="the" on the noun be inferred from the existence of the <The> particle?
NOTE: THIS ONLY WORKS FOR THE DEFINITE ARTICLE
|
boolean |
shouldLowercaseEntityInCompoundNouns() |
String |
toString() |
public LanguageDeclension(HumanLanguage language)
public final HumanLanguage getLanguage()
public abstract List<? extends NounForm> getAllNounForms()
public abstract Collection<? extends NounForm> getEntityForms()
public abstract Collection<? extends NounForm> getFieldForms()
public abstract Collection<? extends NounForm> getOtherForms()
public abstract List<? extends AdjectiveForm> getAdjectiveForms()
public List<? extends ArticleForm> getArticleForms()
protected abstract Noun createNoun(String name, String pluralAlias, Noun.NounType type, String entityName, LanguageStartsWith startsWith, LanguageGender gender, String access, boolean isStandardField, boolean isCopied)
entityName - TODOpublic Noun createNoun(String name, Noun.NounType type, String entityName, LanguageStartsWith startsWith, LanguageGender gender, Map<? extends NounForm,String> forms)
public Noun createNoun(String name, Noun.NounType type, String entityName, ResultSet rs) throws SQLException
name - the name of the nountype - the noun typeentityName - the name of the standard entity this noun is associated with, or null if it's custom or irrelevantrs - a cursor against the label_data or custom_entity_translation tablesSQLExceptionprotected abstract Adjective createAdjective(String name, LanguageStartsWith startsWith, LanguagePosition position)
name - TODOstartsWith - TODOposition - TODOprotected Article createArticle(String name, LanguageArticle articleType)
name - TODOarticleType - the type of articlepublic abstract boolean hasGender()
int[] getRequiredGenders.public abstract boolean hasStartsWith()
Element createStartsWithElement(String, Noun, boolean) too.public boolean hasStartsWithInAdjective()
public boolean hasAutoDerivedStartsWith()
public boolean hasPlural()
public boolean hasPossessive()
public boolean hasPossessiveInAdjective()
public boolean hasArticle()
public boolean hasArticleInNounForm()
public boolean isArticleInNounFormAutoDerived()
public boolean hasRequiredCases()
public boolean hasAllowedCases()
public boolean hasCapitalization()
public EnumSet<LanguageGender> getRequiredGenders()
public EnumSet<LanguageCase> getRequiredCases()
public EnumSet<LanguageCase> getAllowedCases()
public EnumSet<LanguageStartsWith> getRequiredStartsWith()
public EnumSet<LanguagePossessive> getRequiredPossessive()
public LanguageGender getDefaultGender()
public LanguageStartsWith getDefaultStartsWith()
public LanguagePosition getDefaultAdjectivePosition()
public LanguageCase getDefaultCase()
public LanguageArticle getDefaultArticle()
public LanguagePossessive getDefaultPossessive()
public boolean isInflected()
public boolean moveNounInflectionToFirstModifier()
public boolean hasSubjectGenderInVerbConjugation()
public NounForm getExactNounForm(LanguageNumber number, LanguageCase _case, LanguagePossessive possessive, LanguageArticle article)
public Set<LanguageArticle> getAllowedArticleTypes()
public boolean shouldInferNounDefArticleFromParticle()
public NounForm getApproximateNounForm(LanguageNumber number, LanguageCase _case, LanguagePossessive possessive, LanguageArticle article)
public final NounForm getNounForm(LanguageNumber number, LanguageCase caseType)
public final NounForm getNounForm(LanguageNumber number, LanguageArticle articleType)
public AdjectiveForm getAdjectiveForm(AdjectiveForm af)
public AdjectiveForm getAdjectiveForm(LanguageStartsWith startsWith, LanguageGender gender, LanguageNumber number, LanguageCase _case, LanguageArticle article, LanguagePossessive possessive)
public AdjectiveForm getApproximateAdjectiveForm(LanguageStartsWith startsWith, LanguageGender gender, LanguageNumber number, LanguageCase _case, LanguageArticle article, LanguagePossessive possessive)
possessive - TODOpublic ArticleForm getApproximateArticleForm(LanguageStartsWith startsWith, LanguageGender gender, LanguageNumber number, LanguageCase _case)
public ArticleForm getArticleForm(ArticleForm af)
public ArticleForm getArticleForm(LanguageStartsWith startsWith, LanguageGender gender, LanguageNumber number, LanguageCase _case)
public boolean shouldLowercaseEntityInCompoundNouns()
public String formLowercaseNounForm(String s, NounForm form)
s - the string to lowercaseform - the form of the noun to lowercaseprotected static <K extends Enum<K>,V> EnumMap<K,V> enumMapFilterNulls(K k1, V v1, K k2, V v2)
protected static <K extends Enum<K>,V> EnumMap<K,V> enumMapFilterNulls(K k1, V v1, K k2, V v2, K k3, V v3)
protected static <K extends Enum<K>,V> EnumMap<K,V> enumMapFilterNulls(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
Copyright (c) 2016-2017, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE.txt file in the repository.