Package org.omegat.core.segmentation
Class SRXManager
java.lang.Object
org.omegat.core.segmentation.SRXManager
Utility class for SRX segmentation rules.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic SRXstatic @Nullable SRXloadFromDir(File configDir) Loads the local segmentation file.static @Nullable SRXloadSrxFile(URI rulesUri) static SRXlookupRulesForLanguage(SRX srx, Language srclang) Finds the rules for a certain language.static voidSaves segmentation rules into specified directory.
-
Field Details
-
CONF_SENTSEG
- See Also:
-
SRX_SENTSEG
- See Also:
-
-
Method Details
-
getDefault
- Throws:
IOException
-
saveToSrx
Saves segmentation rules into specified directory.- Parameters:
srx- OmegaT object to be written; if null, means that we want to delete the fileoutDir- where to put the file. The file name is forced toSRX_SENTSEGand will be in standard SRX format.- Throws:
IOException
-
loadSrxFile
-
loadFromDir
Loads the local segmentation file. Accepts SRX (default) or old CONF format. In case you use a conf format, rules about an old version remain valid. -
loadSrxInputStream
- Throws:
IOException
-
lookupRulesForLanguage
Finds the rules for a certain language.Usually (if the user didn't screw up the setup) there are default segmentation rules, so it's a good idea to rely on this method always returning at least some rules.
Or in case of a completely screwed setup -- an empty list without any rules.
-