public class MultiDictionary extends java.lang.Object implements Dictionary
Dictionary
that takes its entries from other dictionaries. The
priority of these underlying dictionaries is consistent with the order in
which they are added.
Instances of this class are thread-safe as long as the underlying dictionaries are thread-safe as well.
Modifier and Type | Class and Description |
---|---|
static class |
MultiDictionary.Builder
A builder to create
MultiDictionary instances. |
DUMMY_DICTIONARY
Modifier and Type | Method and Description |
---|---|
boolean |
containsEntry(Entity src,
Entity trg)
Checks whether this bilingual dictionary contains the specified entry.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
translate(Entity entity)
Translates the specified
Entity . |
public java.lang.String translate(Entity entity)
Dictionary
Entity
.translate
in interface Dictionary
entity
- the Entity
to translate.Entity
, or null
if the dictionary doesn't contain any entry for it.public boolean containsEntry(Entity src, Entity trg)
Dictionary
containsEntry
in interface Dictionary
src
- the Entity
in the source language.trg
- the Entity
in the target language.trg
is a valid translation of src
according to this dictionary.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object