| Package | Description |
|---|---|
| net.sf.okapi.common |
Classes commonly used across the whole Okapi Framework.
|
| net.sf.okapi.common.annotation |
Classes to implement and manage annotations.
|
| net.sf.okapi.common.filters |
Interfaces and base classes to implement filters
|
| net.sf.okapi.common.filterwriter |
Interfaces and classes to allow the output of a document in its original
format.
|
| net.sf.okapi.common.query |
Helper classes for the translation resources connectors.
|
| net.sf.okapi.common.resource |
Interfaces and classes that represent the parsed resources attached to the
events sent by a filter.
|
| net.sf.okapi.common.skeleton |
Interfaces and classes for the skeleton objects.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
RenumberingUtil.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 |
RenumberingUtil.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.
|
| Modifier and Type | Method and Description |
|---|---|
AltTranslation |
AltTranslationsAnnotation.add(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin)
Adds a new entry to the list of alternate translations.
|
AltTranslation |
AltTranslationsAnnotation.add(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin,
int fuzzyScore,
int qualityScore)
Adds a new entry to the list of alternate translations.
|
void |
AltTranslation.setTarget(LocaleId targetLocId,
TextFragment alternateTarget)
Sets the target parts of this alternate translation.
|
| Constructor and Description |
|---|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin)
Creates a new AltTranslation object.
|
AltTranslation(LocaleId sourceLocId,
LocaleId targetLocId,
TextFragment originalSource,
TextFragment alternateSource,
TextFragment alternateTarget,
MatchType type,
int combinedScore,
String origin,
int fuzzyScore,
int qualityScore)
Creates a new AltTranslation object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
InlineCodeFinder.process(TextFragment fragment)
Applies the rules to a given content and converts all matching sections
into in-line codes.
|
| Modifier and Type | Method and Description |
|---|---|
static TextFragment |
GenericContent.fromLetterCodedToFragment(String text,
TextFragment fragment,
boolean reuseCodes)
Deprecated.
|
static TextFragment |
GenericContent.fromLetterCodedToFragment(String text,
TextFragment fragment,
boolean reuseCodes,
boolean decodeEncodedLetterCodes)
Converts a letter-coded text to a fragment.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
GenericContent.fromFragmentToLetterCoded(TextFragment fragment)
Deprecated.
|
static String |
GenericContent.fromFragmentToLetterCoded(TextFragment fragment,
boolean encodeExistingLetterCodes)
Converts a text fragment into a letter-coded text, optionally escaping
tags that will interfere with conversion back to a fragment.
|
static TextFragment |
GenericContent.fromLetterCodedToFragment(String text,
TextFragment fragment,
boolean reuseCodes)
Deprecated.
|
static TextFragment |
GenericContent.fromLetterCodedToFragment(String text,
TextFragment fragment,
boolean reuseCodes,
boolean decodeEncodedLetterCodes)
Converts a letter-coded text to a fragment.
|
XLIFFContent |
XLIFFContent.setContent(TextFragment content)
Sets the fragment to format.
|
TMXContent |
TMXContent.setContent(TextFragment content)
Sets the fragment to format.
|
GenericContent |
GenericContent.setContent(TextFragment content) |
XLIFFContent |
XLIFFContent.setContent(TextFragment content,
boolean resetStandoff)
Sets the fragment to format.
|
static void |
GenericContent.updateFragment(String genericText,
TextFragment fragment,
boolean allowCodeDeletion)
Updates a text fragment from a generic representation.
|
void |
TMXWriter.writeAlternate(AltTranslation alt,
TextFragment srcOriginal)
Writes the data of an
AltTranslation to this TMX output. |
protected void |
TMXWriter.writeResourceLevelProperties(Set<String> names,
ITextUnit item,
TextFragment srcSegment) |
void |
TMXWriter.writeTU(TextFragment source,
TextFragment target,
String tuid,
Map<String,String> attributes)
Writes a TMX TU element.
|
void |
TMXWriter.writeTU(TextFragment source,
TextFragment target,
String tuid,
Map<String,String> attributes,
LocaleId altTrgLoc)
Writes a TMX TU element.
|
protected void |
TMXWriter.writeTUV(TextFragment frag,
LocaleId locale,
TextContainer contForProp)
Writes a TUV element.
|
| Constructor and Description |
|---|
GenericContent(TextFragment content) |
TMXContent(TextFragment content)
Creates a new TMXContent object and set its content to the given fragment.
|
XLIFFContent(TextFragment content)
Creates a new XLIFFContent object and set its content to the given fragment.
|
| Modifier and Type | Field and Description |
|---|---|
TextFragment |
QueryResult.source
Text of the source for this result.
|
TextFragment |
QueryResult.target
Text of the target for this result.
|
| Modifier and Type | Method and Description |
|---|---|
int |
IQuery.query(TextFragment text)
Starts a query for a given text.
|
AltTranslation |
QueryResult.toAltTranslation(TextFragment originalSource,
LocaleId sourceLocId,
LocaleId targetLocId)
Convert a QueryResult to an
AltTranslation |
| Modifier and Type | Method and Description |
|---|---|
List<List<QueryResult>> |
IQuery.batchQuery(List<TextFragment> fragments)
Starts a batch query for a given list of
TextFragments. |
| Modifier and Type | Field and Description |
|---|---|
TextFragment |
AnnotatedSpan.span
Copy of the fragment of text to which the annotation is applied.
|
TextFragment |
TextPart.text
Text fragment of this part.
|
| Modifier and Type | Method and Description |
|---|---|
TextFragment |
TextFragment.append(char value)
Appends a character to the fragment.
|
TextFragment |
TextFragment.append(CharSequence csq)
Appends the specified character sequence to this fragment.
|
TextFragment |
TextFragment.append(CharSequence csq,
int start,
int end)
Appends a subsequence of the specified character sequence to this fragment.
|
TextFragment |
TextFragment.append(Code code)
Appends an existing code to this fragment.
|
TextFragment |
TextFragment.append(String text)
Appends a string to the fragment.
|
TextFragment |
TextFragment.append(TextFragment fragment)
Appends a TextFragment object to this fragment.
|
TextFragment |
TextFragment.append(TextFragment fragment,
boolean keepCodeIds) |
TextFragment |
TextFragment.cleanCodes()
Removes all codes both in the Codes list and the markers.
|
TextFragment |
TextFragment.clone()
Clones this TextFragment.
|
TextFragment |
TextContainer.createJoinedContent() |
static TextFragment |
TextUnitUtil.expandCodes(TextFragment tf)
Expand codes that have been previously merged.
|
static TextFragment |
TextUnitUtil.extractSegMarkers(TextFragment tf,
TextFragment original,
boolean removeFromOriginal)
Extracts segment and text part markers from a given string, creates codes (place-holder type) for those markers,
and appends them to a given text fragment.
|
TextFragment |
TextPart.getContent()
Gets the text fragment for this part.
|
TextFragment |
TextContainer.getFirstContent()
Gets the content of the first part (segment or non-segment) of this container.
|
TextFragment |
Segments.getFirstContent() |
TextFragment |
ISegments.getFirstContent()
Gets the content of the first segment of this container.
|
TextFragment |
TextContainer.getLastContent()
Gets the content of the last part (segment or non-segment) of this container.
|
TextFragment |
Segments.getLastContent() |
TextFragment |
ISegments.getLastContent()
Gets the content of last segment of this container.
|
TextFragment |
TextContainer.getUnSegmentedContentCopy()
Gets a new TextFragment representing the un-segmented content of this container.
|
static TextFragment |
TextFragmentUtil.removeMoreThanMaxCodes(TextFragment tf) |
TextFragment |
TextUnit.setSourceContent(TextFragment content) |
TextFragment |
ITextUnit.setSourceContent(TextFragment content)
Sets the content of the source for this TextUnit.
|
TextFragment |
TextUnit.setTargetContent(LocaleId locId,
TextFragment content) |
TextFragment |
ITextUnit.setTargetContent(LocaleId locId,
TextFragment content)
Sets the content of the target for a given locale for this TextUnit.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextContainer tc,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given possibly segmented text container.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
boolean removeLeadingTrailingCodes)
Simplifies all possible tags in a given text fragment.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
int maxIterations,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextContainer tc,
String rules,
boolean removeLeadingTrailingCodes)
Simplifies all possible tags in a given text container.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextContainer tc,
String rules,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text container.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextFragment tf,
String rules,
boolean removeLeadingTrailingCodes)
Simplifies all possible tags in a given text fragment.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextFragment tf,
String rules,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
static TextFragment |
TextUnitUtil.storeSegmentation(TextContainer tc) |
TextFragment |
TextFragment.subSequence(int start,
int end)
Gets a copy of a sub-sequence of this object.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
TextFragmentUtil.addMissingCodes(TextFragment from,
TextFragment to,
CodeMatches codeMatches)
Add missing leading and trailing codes on target (aka 'to').
|
static CodeMatches |
TextFragmentUtil.alignAndCopyCodeMetadata(TextFragment from,
TextFragment to)
Update the meta fields in
Code "to" that match those of
"from" But only if the "to" code has empty data. |
static CodeMatches |
TextFragmentUtil.alignAndCopyCodeMetadata(TextFragment from,
TextFragment to,
boolean addMissingCodes)
Update the meta fields in
Code "to" that match those of
"from" But only if the "to" code has empty data (@see{forceCopy}). |
static CodeMatches |
TextFragmentUtil.alignAndCopyCodeMetadata(TextFragment from,
TextFragment to,
boolean addMissingCodes,
boolean forceCopy)
Update the meta fields in
Code "to" that match those of
"from" But only if the "to" code has empty data (@see{forceCopy}). |
void |
TextFragment.alignCodeIds(TextFragment base)
Aligns the code IDs of this fragment with the ones of a given fragment.
|
void |
TextContainer.append(TextFragment fragment)
Appends a part at the end of this container.
|
TextFragment |
TextFragment.append(TextFragment fragment)
Appends a TextFragment object to this fragment.
|
void |
Segments.append(TextFragment fragment) |
void |
ISegments.append(TextFragment fragment)
Appends a TextFragment as a segment at the end of this container.
|
void |
TextContainer.append(TextFragment fragment,
boolean collapseIfPreviousEmpty)
Appends a part at the end of this container.
|
TextFragment |
TextFragment.append(TextFragment fragment,
boolean keepCodeIds) |
void |
Segments.append(TextFragment fragment,
boolean collapseIfPreviousEmpty) |
void |
ISegments.append(TextFragment fragment,
boolean collapseIfPreviousEmpty)
Appends a TextFragment as a segment at the end of this container.
|
void |
TextContainer.append(TextFragment fragment,
boolean collapseIfPreviousEmpty,
boolean keepCodeIds)
Appends a part at the end of this container.
|
int |
TextFragment.compareTo(TextFragment tf)
Compares an object with this TextFragment.
|
int |
TextFragment.compareTo(TextFragment frag,
boolean codeSensitive)
Deprecated.
Use compareTo(TextFragment, CompareMode)
|
int |
TextFragment.compareTo(TextFragment frag,
TextFragment.CompareMode compMode)
Compares with another TextFragment.
|
static void |
TextFragmentUtil.copyCodeMetadata(TextFragment sf,
TextFragment tf,
boolean forceCopy,
CodeMatches cm) |
static void |
TextUnitUtil.deleteLastChar(TextFragment textFragment)
Deletes the last non-whitespace and non-code character of a given text fragment.
|
static boolean |
TextUnitUtil.endsWith(TextFragment textFragment,
String substr)
Indicates if a given text fragment ends with a given sub-string.
|
static TextFragment |
TextUnitUtil.expandCodes(TextFragment tf)
Expand codes that have been previously merged.
|
static TextFragment |
TextUnitUtil.extractSegMarkers(TextFragment tf,
TextFragment original,
boolean removeFromOriginal)
Extracts segment and text part markers from a given string, creates codes (place-holder type) for those markers,
and appends them to a given text fragment.
|
static int |
TextFragment.fromFragmentToString(TextFragment frag,
int pos)
Gets the position in the string representation of a fragment of a given
position in that fragment.
|
static String |
TextUnitUtil.getCodedText(TextFragment textFragment)
Gets text of a given text fragment object possibly containing inline codes.
|
static char |
TextUnitUtil.getLastChar(TextFragment textFragment)
Gets the last character of a given text fragment.
|
static String |
TextUnitUtil.getText(TextFragment textFragment)
Extracts text from the given text fragment.
|
static String |
TextUnitUtil.getText(TextFragment textFragment,
List<Integer> markerPositions)
Extracts text from the given text fragment.
|
static boolean |
TextUnitUtil.hasMergedCode(TextFragment tf) |
void |
TextFragment.insert(int offset,
TextFragment fragment)
Inserts a TextFragment object to this fragment.
|
void |
TextFragment.insert(int offset,
TextFragment fragment,
boolean keepCodeIds)
Inserts a TextFragment object to this fragment.
|
static boolean |
TextUnitUtil.isEmpty(TextFragment textFragment)
Indicates if a given text fragment object is null, or the text it contains is null or empty.
|
static boolean |
TextFragmentUtil.isLeadingCode(Code code,
TextFragment source)
Determine if the code is at the beginning of the
TextFragment without
intervening text. |
static boolean |
TextUnitUtil.isWellformed(TextFragment tf) |
static int |
TextUnitUtil.lastIndexOf(TextFragment textFragment,
String findWhat)
Returns the index (within a given text fragment object) of the rightmost occurrence of the specified substring.
|
static void |
TextFragmentUtil.logCodeMismatchErrors(CodeMatches matches,
TextFragment from,
TextFragment to,
String textUnitId)
Log all code mismatch issues
|
static boolean |
TextFragmentUtil.moreThanMaxCodes(TextFragment tf) |
static String |
TextUnitUtil.printMarkerIndexes(TextFragment textFragment) |
static String |
TextUnitUtil.printMarkers(TextFragment textFragment) |
static void |
TextUnitUtil.removeCodes(TextFragment tf)
Removes all inline tags from the given
TextFragment |
static TextFragment |
TextFragmentUtil.removeMoreThanMaxCodes(TextFragment tf) |
static String |
TextUnitUtil.restoreSegmentation(TextContainer tc,
TextFragment segStorage)
Restores original segmentation of a given text container from a given text fragment created with storeSegmentation().
|
void |
TextContainer.setContent(TextFragment content)
Sets the content of this TextContainer.
|
void |
TextPart.setContent(TextFragment fragment)
Sets the
TextFragment for this part. |
TextFragment |
TextUnit.setSourceContent(TextFragment content) |
TextFragment |
ITextUnit.setSourceContent(TextFragment content)
Sets the content of the source for this TextUnit.
|
TextFragment |
TextUnit.setTargetContent(LocaleId locId,
TextFragment content) |
TextFragment |
ITextUnit.setTargetContent(LocaleId locId,
TextFragment content)
Sets the content of the target for a given locale for this TextUnit.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
boolean removeLeadingTrailingCodes)
Simplifies all possible tags in a given text fragment.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
TextFragment[] |
CodeSimplifier.simplifyAll(TextFragment tf,
int maxIterations,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextFragment tf,
String rules,
boolean removeLeadingTrailingCodes)
Simplifies all possible tags in a given text fragment.
|
static TextFragment[] |
TextUnitUtil.simplifyCodes(TextFragment tf,
String rules,
boolean removeLeadingTrailingCodes,
boolean mergeCodes)
Simplifies all possible tags in a given text fragment.
|
void |
CodeSimplifier.simplifyEmptyOpeningClosing(TextFragment tf) |
void |
CodeSimplifier.simplifyIsolated(TextFragment tf)
Simplifies the place-holders in a given text fragment.
|
void |
CodeSimplifier.simplifyOpeningClosing(TextFragment tf) |
static CodeMatches |
TextFragmentUtil.synchronizeCodeIds(TextFragment from,
TextFragment to)
Matches the code IDs of the
from |
static String |
TextFragmentUtil.toText(TextFragment tf)
Render the
TextFragment including all Codes. |
static String |
TextUnitUtil.toText(TextFragment tf)
Returns the content of a given text fragment, including the original codes whenever
possible.
|
static void |
TextUnitUtil.trimLeading(TextFragment textFragment)
Removes leading whitespaces from a given text fragment.
|
static void |
TextUnitUtil.trimLeading(TextFragment textFragment,
GenericSkeleton skel)
Removes leading whitespaces from a given text fragment, puts removed whitespaces to the given skeleton.
|
static void |
TextUnitUtil.trimTrailing(TextFragment textFragment)
Removes trailing whitespaces from a given text fragment.
|
static void |
TextUnitUtil.trimTrailing(TextFragment textFragment,
GenericSkeleton skel)
Removes trailing whitespaces from a given text fragment, puts removed whitespaces to the given skeleton.
|
static void |
TextFragment.unwrap(TextFragment frag)
Unwraps the content of a TextFragment.
|
| Constructor and Description |
|---|
AnnotatedSpan(String type,
InlineAnnotation annotation,
TextFragment span,
int start,
int end)
Creates a new AnnotatedSpan object with a give type of annotation,
its annotation and its fragment of text.
|
CodeMatches(TextFragment from,
TextFragment to) |
Segment(String id,
TextFragment text)
Creates a Segment object with a given identifier and a given
text fragment.
|
TextContainer(TextFragment fragment)
Creates a new TextContainer object with an initial TextFragment.
|
TextFragment(TextFragment fragment)
Creates a TextFragment with the content of a given TextFragment.
|
TextPart(String id,
TextFragment text)
Creates a new TextPart with a given
TextFragment. |
TextPart(TextFragment text)
Creates a new TextPart with a given
TextFragment. |
| Modifier and Type | Method and Description |
|---|---|
String |
GenericSkeletonWriter.getContent(TextFragment tf,
LocaleId locToUse,
EncoderContext context)
Gets the original content of a TextFragment.
|
Copyright © 2021. All rights reserved.