Normation: Implementing language specific features
General
With normation you can implement phonetic searches for a language and a lot more. For normation a Java class needs to be implemented. The name of this Java class is provided in the property languageXNormationClassName.
The class name needs to include the package identification (no package identification if default package is used).
Per convention the Normation classes have as name NormationXXX where XXX is the value from the property languageXFilePostfix.
The normation class needs to inherit from the class de.kugihan.dictionaryformids.normation.Normation and provide a language specific implementation for the methods of the Normation class. Here is an extract from the Normation class:
package de.kugihan.dictionaryformids.translation.normation;
public class Normation {
public StringBuffer normateWord(StringBuffer nonNormatedWord) {
// default is to do nothing
return nonNormatedWord;
}
public Vector searchWord(String text) {
// default is to do return only the provided text
Vector words = new Vector();
words.addElement(new SearchedWord(text));
return words;
}
public Vector suggestionWord(String text) {
// default is to do return no suggestion
Vector suggestions = new Vector();
return suggestions;
}
}
Writing Normation-classes is an easy task for the Java part. If you know some rules for a language but you do not know how to implement in Java or you do not have an Java development environment, send us the rules and we will implement them.
In any case, if you did implement a Normation class, please send it to us, so that we can make it available for other people who set up a dictionary. So far there is a Normation class for German (NormationGer), Japanese (NormationJpn), Vietnamese (NormationVie), Filipino/Cebuano (NormationFil) and a general version that does a first level of normation for latin-based languages in general (NormationLat). The latin normation this class 'removes extra punctiation' from characters, so that for example "señora" is also found when searching for "senora".
Someone to take care for the Normation class for English ? Would be urgently
needed !
Implementation of method normatedWord
Overwrite the method normateWord for support of phonetic search. Or for search of words that have different spellings. This method takes a nonNormatedWord and returns a normed representation of that word.
Example: NormationGer parses the nonNormatedWord for the German 'Umlauts' (ä, ö, ü) and returns the word with the Umlaut-paraphrasing (ae, oe, ue). So the user can search for "Mädchen" or "Maedchen" and the translation will be found in both cases.
Implementation of method searchWord
With searchWord you can generate additional words that are searched. searchWord returns a Vector of SearchedWord.
Example: NormationJpn generates for a Hiragana word the Katakana
representation. When the user enters a Hiragana word, the search done
for both Hiragana and Katakana.
Implementation of method suggestionWord
With suggestionWord you can generate additional words that are suggested to the user when no match is found. The user then can pick a suggestion and re-run the translation. suggestionWord returns a Vector of SuggestedWord.