Class LayerProvider
- java.lang.Object
-
- net.sf.okapi.common.layerprovider.LayerProvider
-
- All Implemented Interfaces:
IEncoder,ILayerProvider
public class LayerProvider extends Object implements ILayerProvider
-
-
Constructor Summary
Constructors Constructor Description LayerProvider()LayerProvider(CharsetEncoder outputEncoder, String lineBreak)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringencode(char value, EncoderContext context)Encodes a given character with this encoding.Stringencode(int value, EncoderContext context)Encodes a given code-point with this encoding.Stringencode(String text, EncoderContext context)Encodes a given text with this encoder.StringendCode()Gets the string denoting the end of external codes.StringendInline()Gets the string denoting the end of inline codes.StringendSegment()Gets the string denoting the end of a bilingual segment.CharsetEncodergetCharsetEncoder()Gets the character set encoder used for this encoder.StringgetEncoding()Gets the name of the charset encoding to use.StringgetLineBreak()Gets the line-break to use for this encoder.IParametersgetParameters()Gets the parameters object with all the configuration information specific to this encoder.StringmidSegment(int leverage)Gets the string for the separator at the middle of a bilingual segment.voidreset()Reset state in this encoder in preparation for processing new content.voidsetOptions(IParameters params, String encoding, String lineBreak)Sets the options for this encoder.StringstartCode()Gets the string denoting the start of external codes.StringstartInline()Gets the string denoting the start of inline codes.StringstartSegment()Gets the string denoting the start of a bilingual segment.StringtoNative(String propertyName, String value)Converts any property values from its standard representation to the native representation for this encoder.
-
-
-
Constructor Detail
-
LayerProvider
public LayerProvider()
-
LayerProvider
public LayerProvider(CharsetEncoder outputEncoder, String lineBreak)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:IEncoderReset state in this encoder in preparation for processing new content.
-
endCode
public String endCode()
Description copied from interface:ILayerProviderGets the string denoting the end of external codes.- Specified by:
endCodein interfaceILayerProvider- Returns:
- The string denoting the end of external codes.
-
endInline
public String endInline()
Description copied from interface:ILayerProviderGets the string denoting the end of inline codes.- Specified by:
endInlinein interfaceILayerProvider- Returns:
- The string denoting the end of inlinel codes.
-
startCode
public String startCode()
Description copied from interface:ILayerProviderGets the string denoting the start of external codes.- Specified by:
startCodein interfaceILayerProvider- Returns:
- The string denoting the start of external codes.
-
startInline
public String startInline()
Description copied from interface:ILayerProviderGets the string denoting the start of inline codes.- Specified by:
startInlinein interfaceILayerProvider- Returns:
- The string denoting the start of inlinel codes.
-
startSegment
public String startSegment()
Description copied from interface:ILayerProviderGets the string denoting the start of a bilingual segment.- Specified by:
startSegmentin interfaceILayerProvider- Returns:
- The string denoting the start of a bilingual segment.
-
endSegment
public String endSegment()
Description copied from interface:ILayerProviderGets the string denoting the end of a bilingual segment.- Specified by:
endSegmentin interfaceILayerProvider- Returns:
- The string denoting the end of a bilingual segment.
-
midSegment
public String midSegment(int leverage)
Description copied from interface:ILayerProviderGets the string for the separator at the middle of a bilingual segment.- Specified by:
midSegmentin interfaceILayerProvider- Parameters:
leverage- Indicator of leverage to optionally place in the separator.- Returns:
- The string for the separator at the middle of a bilingual segment.
-
encode
public String encode(String text, EncoderContext context)
Description copied from interface:IEncoderEncodes a given text with this encoder.
-
encode
public String encode(char value, EncoderContext context)
Description copied from interface:IEncoderEncodes a given character with this encoding.
-
encode
public String encode(int value, EncoderContext context)
Description copied from interface:IEncoderEncodes a given code-point with this encoding. If this method is called from a loop it is assumed that the code point is tested by the caller to know if it is a supplemental one or not and and any index update to skip the low surrogate part of the pair is done on the caller side.
-
setOptions
public void setOptions(IParameters params, String encoding, String lineBreak)
Description copied from interface:IEncoderSets the options for this encoder.- Specified by:
setOptionsin interfaceIEncoder- Parameters:
params- the parameters object with all the configuration information specific to this encoder.encoding- the name of the charset encoding to use.lineBreak- the type of line break to use.
-
toNative
public String toNative(String propertyName, String value)
Description copied from interface:IEncoderConverts any property values from its standard representation to the native representation for this encoder.
-
getLineBreak
public String getLineBreak()
Description copied from interface:IEncoderGets the line-break to use for this encoder.- Specified by:
getLineBreakin interfaceIEncoder- Returns:
- the line-break used for this encoder.
-
getCharsetEncoder
public CharsetEncoder getCharsetEncoder()
Description copied from interface:IEncoderGets the character set encoder used for this encoder.- Specified by:
getCharsetEncoderin interfaceIEncoder- Returns:
- the character set encoder used for this encoder. This can be null.
-
getParameters
public IParameters getParameters()
Description copied from interface:IEncoderGets the parameters object with all the configuration information specific to this encoder.- Specified by:
getParametersin interfaceIEncoder- Returns:
- the parameters object used for this encoder. This can be null.
-
getEncoding
public String getEncoding()
Description copied from interface:IEncoderGets the name of the charset encoding to use.- Specified by:
getEncodingin interfaceIEncoder- Returns:
- the charset encoding used for this encoder.
-
-