class DateMatcherTranslator extends Serializable
- Alphabetic
- By Inheritance
- DateMatcherTranslator
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new DateMatcherTranslator(policy: DateMatcherTranslatorPolicy)
Type Members
- type DateMatcherIndexedToken = (String, Int)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val AccentsPattern: String
- val DigitsPattern: String
- val EmptyStr: String
- val Encoding: String
- val English: String
- val JsonSuffix: String
- val KeyPlaceholder: String
- val NameKey: String
- val NotAvailable: String
- val NotDetected: String
- val NotFound: String
- val PunctuationPattern: String
- val SkipChar: String
- val SpaceChar: String
- val SupportedLanguagesFilePath: String
- val TranslationDataBaseDir: String
- val ValuePlaceholder: String
-
def
_processSourceLanguageInfo(text: String, sourceLanguage: String): Map[String, Set[String]]
Load available language keys to process further matches
Load available language keys to process further matches
- text
: text to match language against.
- returns
a map containing the matching languages.
- def adjustPlurality(text: String): String
-
def
applyTranslation(translatedIndexedToken: Array[(String, Int)], text: String): String
Apply translation switching token where an index has been translated using the dictionary matching.
Apply translation switching token where an index has been translated using the dictionary matching.
- translatedIndexedToken
: the translated index token to replace in text.
- text
: the original text where translation is applied.
- returns
the text translated using token replacement.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getKeyFromDictionaryValue(toBeReplaced: Array[String], sourceLanguage: String): Iterable[(String, String)]
-
def
getPolicy(): DateMatcherTranslatorPolicy
Return one policy in [single, multi] associated to this translator
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def listify(any: Any): List[Any]
-
def
loadDictionary(language: String = English): Map[String, Any]
Load dictionary from supported language repository.
Load dictionary from supported language repository.
- language
the language dictionary to load. Default is English.
- returns
a map containing the language dictionary or throws an exception.
-
def
matchIndexedToken: (DateMatcherIndexedToken, Map[String, Any]) ⇒ DateMatcherIndexedToken
Matches the indexed text token against the passed dictionary.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def preprocessSortedByLengthMatches(sortedMatches: List[String], policy: DateMatcherTranslatorPolicy): List[String]
-
def
processSourceLanguageInfo(text: String, sourceLanguage: String): Map[String, Set[String]]
Process date matches with the source language.
Process date matches with the source language.
- text
: the text to detect.
- returns
the detected language as tuple of matched languages with their frequency.
- def searchKeyFromValuesMatch(dictionary: Map[String, Any], k: String, toBeReplaced: String): (String, String)
- def stringValuesToRegexes(regexValuesIntersection: Set[String], sourceLanguage: String): Set[Regex]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
translate(text: String, sourceLanguage: String, destination: String = English): String
Translate the text from source language to destination language.
Translate the text from source language to destination language.
- sourceLanguage
the source language.
- destination
the destination language.
- returns
the translated text from source language to destination language.
-
def
translateBySentence(text: String, sourceLanguageInfo: Map[String, Set[String]], policy: DateMatcherTranslatorPolicy): String
Translate sentence from source info.
Translate sentence from source info.
- text
: sentence to translate.
- sourceLanguageInfo
: the source info map.
- returns
the translated sentence.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()