Class SimpleTB
- java.lang.Object
-
- net.sf.okapi.lib.terminology.simpletb.SimpleTB
-
public class SimpleTB extends Object
Very basic memory-only simple termbase. This is used for prototyping the terminology interface.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EntryaddEntry(String srcTerm, String trgTerm)List<TermHit>getExistingStrings(TextFragment frag, LocaleId fragmentLoc, LocaleId otherLoc)List<TermHit>getExistingTerms(TextFragment frag, LocaleId fragmentLoc, LocaleId otherLoc)voidguessAndImport(File file)voidimportCSV(File file)voidimportTBX(File file)voidimportTSV(File file)voidinitialize(boolean stringSearch, boolean betweenCodes)static booleanisValidMatch(StringBuilder text, String stringToMatch, Range location, boolean betweenCodes)Searches for a given string in a text.voidload(String path)voidremoveAll()voidsave(String path)
-
-
-
Method Detail
-
initialize
public void initialize(boolean stringSearch, boolean betweenCodes)
-
guessAndImport
public void guessAndImport(File file)
-
importTBX
public void importTBX(File file)
-
importCSV
public void importCSV(File file)
-
importTSV
public void importTSV(File file)
-
removeAll
public void removeAll()
-
getExistingStrings
public List<TermHit> getExistingStrings(TextFragment frag, LocaleId fragmentLoc, LocaleId otherLoc)
-
isValidMatch
public static boolean isValidMatch(StringBuilder text, String stringToMatch, Range location, boolean betweenCodes)
Searches for a given string in a text. The location parameter is updated with the position of the first character and the one of the character after the last one.- Parameters:
text- Text where to search the strings.stringToMatch- the string to search for.location- location of the term.- Returns:
- true if it's a match, false otherwise. If the return is true, the values in location are updated.
-
getExistingTerms
public List<TermHit> getExistingTerms(TextFragment frag, LocaleId fragmentLoc, LocaleId otherLoc)
-
save
public void save(String path)
-
load
public void load(String path)
-
-