Package net.sf.okapi.lib.merge.merge
Interface ITextUnitMerger
-
- All Known Implementing Classes:
TextUnitMerger,TextUnitMergerSerialized
public interface ITextUnitMerger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcopyCodeMetadata(TextFragment from, TextFragment to)Update the meta fields inCode's "to" that match those of "from" But only if the "to" code has empty data.default voidcopyTextPartMetadata(List<TextPart> from, List<TextPart> to, String id)ParametersgetParameters()ITextUnitmergeTargets(ITextUnit tuFromSkeleton, ITextUnit tuFromTranslation)Merges the translated text unit to the one from the skeleton.voidsetParameters(Parameters params)voidsetTargetLocale(LocaleId trgLoc)
-
-
-
Method Detail
-
mergeTargets
ITextUnit mergeTargets(ITextUnit tuFromSkeleton, ITextUnit tuFromTranslation)
Merges the translated text unit to the one from the skeleton. Merges the text unit's target (under certain conditions).- Parameters:
tuFromSkeleton- text unit from the skeleton (normally the original file)tuFromTranslation- text unit from the translation (default merger uses xliff 1.2)- Returns:
- the merged text unit
-
copyCodeMetadata
default void copyCodeMetadata(TextFragment from, TextFragment to)
Update the meta fields inCode's "to" that match those of "from" But only if the "to" code has empty data. Otherwise keep the to code data as-is. Codes match if both data andTagTypeare the same.- Parameters:
from-TextFragmentcodes are used to match codes in "to"to-TextFragmentthat has its code id's updated to match "from"
-
copyTextPartMetadata
default void copyTextPartMetadata(List<TextPart> from, List<TextPart> to, String id)
Update the meta fields fromTextPart's in "to" that match those of "from"WARNING: Not all TextParts have id's to match on. Fallback is to match on data, but this can be ambiguous in rare cases
-
setTargetLocale
void setTargetLocale(LocaleId trgLoc)
-
getParameters
Parameters getParameters()
-
setParameters
void setParameters(Parameters params)
-
-