public enum LabelUtils extends Enum<LabelUtils>
| Modifier and Type | Class and Description |
|---|---|
static class |
LabelUtils.Nounifier
A structure generated from a dictionary that performs a simple "nounification" process
to determine if there should be some "tokenization" of the string.
|
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
static LabelUtils |
get() |
static List<URL> |
getFileNames(HumanLanguage language,
URL rootDirectory,
String basename) |
String |
getFormDescriptionInEnglish(LanguageDeclension declension,
NounForm form)
Provide an english-list description of a noun form.
|
static String |
getParentLevelPath(int levels)
If you have a URL from Class.getResoruce, what do you provide to the URL constructor to get to the directory
levels above the current one with that URL as the context
|
String |
getPublicString(GrammaticalLabelSet labelSet,
String section,
String param) |
static String |
getSampleGrammarFile(String grammar)
Construct a valid names.xml style file out of the user-entered grammar file.
|
static String |
getSampleLabelFile(String text)
Construct a valid labels.xml style file for the given text, where the label will be at
LabelRef("Test","Test").
|
String |
nounify(String input,
LanguageDictionary dictionary)
Given a non-nounified input, try to replace nouns and adjectives from the dictionary
with the appropriate noun xml tags.
|
String |
processMissingLabel(String message)
Will either throw an exception or log the missing label, depending on
whether or not we're in production
|
String |
processMissingLabel(String labelSection,
String labelId) |
static LabelUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LabelUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LabelUtils INSTANCE
public static LabelUtils[] values()
for (LabelUtils c : LabelUtils.values()) System.out.println(c);
public static LabelUtils valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static LabelUtils get()
public String processMissingLabel(String message)
message - - String to return and log withpublic String getFormDescriptionInEnglish(LanguageDeclension declension, NounForm form)
declension - the language being declinedform - the noun form in questionpublic String getPublicString(GrammaticalLabelSet labelSet, String section, String param) throws IllegalArgumentException
labelSet - the label set that contains thesection - the section to returnparam - the key to the label to returnIllegalArgumentException - if you cannot access this labelpublic static String getSampleGrammarFile(String grammar)
grammar - XML snippetpublic static String getSampleLabelFile(String text)
text - the unescaped text to place inside the label, or to construct an alias if the string
starts with "alias="public String nounify(String input, LanguageDictionary dictionary)
public static List<URL> getFileNames(HumanLanguage language, URL rootDirectory, String basename)
public static String getParentLevelPath(int levels)
levels - the number of directories to go upURL.URL(URL, String) to get the URL to be levels aboveCopyright (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.