public class RenumberingUtil extends Object
| Constructor and Description |
|---|
RenumberingUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateCodeOffset(TextFragment tf)
Find the minimum ID of any code in the TextFragment, then
use that to calculate the offset/delta by which all code
IDs in the TextFragment need to be adjusted.
|
static boolean |
containsOnlyMatchingCodes(TextFragment tf)
Check to see if this text fragment contains either open or closed
tags that do not have a corresponding paired tag within the same
TextFragment.
|
static void |
renumberCodesForDesegmentation(TextContainer tc)
Reverse the renumbering process that was performed during segmentation.
|
static void |
renumberCodesForSegmentation(TextContainer tc)
Renumber the codes in a TextContainer for segmentation.
|
static void |
renumberTextUnitCodes(ITextUnit tu,
LocaleId trgLocale)
Renumber the codes in the TextUnit's source container, then align with
the codes in the target.
|
public static void renumberCodesForSegmentation(TextContainer tc)
tc - TextContainer to renumberpublic static void renumberTextUnitCodes(ITextUnit tu, LocaleId trgLocale)
tu - ITextUnit to renumbertrgLocale - the target locale.public static int calculateCodeOffset(TextFragment tf)
tf - TextFragment to examinepublic static boolean containsOnlyMatchingCodes(TextFragment tf)
tf - the text fragment.public static void renumberCodesForDesegmentation(TextContainer tc)
tc - the text container to renumber.Copyright © 2022. All rights reserved.