Package net.sf.okapi.filters.table.base
Class Parameters
- java.lang.Object
-
- net.sf.okapi.common.BaseParameters
-
- net.sf.okapi.common.StringParameters
-
- net.sf.okapi.common.AbstractGroupParameters
-
- net.sf.okapi.filters.plaintext.base.Parameters
-
- net.sf.okapi.filters.table.base.Parameters
-
- All Implemented Interfaces:
Cloneable,IParameters,ISimplifierRulesParameters
- Direct Known Subclasses:
Parameters,Parameters,Parameters
public class Parameters extends Parameters
Base Table Filter parameters- Version:
- 0.1, 09.06.2009
-
-
Field Summary
Fields Modifier and Type Field Description intcolumnNamesLineNumNumber of the line (1-based) containing field names (column captions).StringcommentColumnsIndicates which columns contain comments.StringcommentSourceRefsIndicates which source columns the comment columns on the commentColumns list correspond to.static intDETECT_COLUMNS_COL_NAMESstatic intDETECT_COLUMNS_FIXED_NUMBERstatic intDETECT_COLUMNS_NONEintdetectColumnsModeThe filter can detect number of columns in the input.booleanexposeCommentsAsMetadataIf true, expose values from commentColumns as trans-unit metadata (properties), rather than as notes.intnumColumnsNumber of columns in the input.intrecordIdColumnIndex (1-based) of the column containing an optional record ID (or a key) of the current row in the table.static intSEND_COLUMNS_ALLstatic intSEND_COLUMNS_LISTEDstatic intSEND_COLUMNS_NONEstatic intSEND_HEADER_ALLstatic intSEND_HEADER_COLUMN_NAMES_ONLYstatic intSEND_HEADER_NONEintsendColumnsModeSpecifies values of which columns should be sent as text units SEND_COLUMNS_NONE = 0 - none of the columns are sent as text units SEND_COLUMNS_LISTED = 1 - only values from the columns listed in idColumns, sourceColumns, targetColumns, commentColumns will be sent SEND_COLUMNS_ALL = 2 - values from all columns will be sent.intsendHeaderModeIf there are one or more lines containing description of the data, names of fields etc., and actual data don't start in the first line, then such first lines are considered a header, and this option specifies how to handle them: SEND_HEADER_NONE = 0 - none of the header lines are sent as text units SEND_HEADER_FIELD_NAMES_ONLY = 1 - only the values in the line specified by fieldNamesLineNum are sent as text units SEND_HEADER_ALL = 2 - values in all header lines are sent as text unitsStringsourceColumnsIndicates which columns contain source text.StringsourceIdColumnsIndicates which columns contain source IDs.StringsourceIdSourceRefsIndicates which source columns the source ID columns on the sourceIdSourceRefs list correspond to.StringsourceIdSuffixesIf there is the recordIdColumn index, and a source ID for the given column is not specified in the sourceIdColumns, then the source ID for that column is compiled of the value in recordIdColumn column, and the corresponding suffix in the sourceIdSuffixes.StringtargetColumnsIndicates which columns contain target text.StringtargetLanguagesIndicates which languages should be used in target columns.StringtargetSourceRefsIndicates which source columns the target columns on the targetColumns list correspond to.static intTRIM_ALLstatic intTRIM_NONEstatic intTRIM_NONQUALIFIED_ONLYinttrimModeSpecifies how field values are trimmed of spaces: TRIM_NONE = 0 - field values are not trimmed TRIM_NONQUALIFIED_ONLY = 1 - only non-qualified field values are trimmed, leading and trailing spaces remain in qualified fields TRIM_ALL = 2 - both non-qualified and qualified field values are trimmed of leading and trailing spaces.intvaluesStartLineNumNumber of the line (1-based) where actual data start after the header.-
Fields inherited from class net.sf.okapi.filters.plaintext.base.Parameters
codeFinderRules, preserveWS, subfilter, trimLeading, trimTrailing, unescapeSource, useCodeFinder, wrapMode
-
Fields inherited from class net.sf.okapi.common.StringParameters
buffer
-
Fields inherited from class net.sf.okapi.common.BaseParameters
path
-
Fields inherited from interface net.sf.okapi.common.ISimplifierRulesParameters
SIMPLIFIERRULES, SIMPLIFIERRULES_DISPLAY_NAME, SIMPLIFIERRULES_SHORT_DESC
-
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidload(ParametersString buffer)Load from buffer.voidreset()Reset this parameters object to its default values.protected voidsave(ParametersString buffer)Save to buffer.-
Methods inherited from class net.sf.okapi.common.AbstractGroupParameters
fromString, getData, getSimplifierRules, loadFromResource, loadGroup, loadGroup, saveGroup, saveGroup, saveToResource, setSimplifierRules, toString, validateSimplifierRules
-
Methods inherited from class net.sf.okapi.common.StringParameters
fromString, getBoolean, getGroup, getInteger, getString, setBoolean, setGroup, setInteger, setString
-
Methods inherited from class net.sf.okapi.common.BaseParameters
getParametersDescription, getPath, load, load, save, setPath
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.IParameters
copy
-
-
-
-
Field Detail
-
DETECT_COLUMNS_NONE
public static final int DETECT_COLUMNS_NONE
- See Also:
detectColumnsMode, Constant Field Values
-
DETECT_COLUMNS_COL_NAMES
public static final int DETECT_COLUMNS_COL_NAMES
- See Also:
- Constant Field Values
-
DETECT_COLUMNS_FIXED_NUMBER
public static final int DETECT_COLUMNS_FIXED_NUMBER
- See Also:
- Constant Field Values
-
SEND_HEADER_NONE
public static final int SEND_HEADER_NONE
- See Also:
sendHeaderMode, Constant Field Values
-
SEND_HEADER_COLUMN_NAMES_ONLY
public static final int SEND_HEADER_COLUMN_NAMES_ONLY
- See Also:
- Constant Field Values
-
SEND_HEADER_ALL
public static final int SEND_HEADER_ALL
- See Also:
- Constant Field Values
-
SEND_COLUMNS_NONE
public static final int SEND_COLUMNS_NONE
- See Also:
sendColumnsMode, Constant Field Values
-
SEND_COLUMNS_LISTED
public static final int SEND_COLUMNS_LISTED
- See Also:
- Constant Field Values
-
SEND_COLUMNS_ALL
public static final int SEND_COLUMNS_ALL
- See Also:
- Constant Field Values
-
TRIM_NONE
public static final int TRIM_NONE
- See Also:
trimMode, Constant Field Values
-
TRIM_NONQUALIFIED_ONLY
public static final int TRIM_NONQUALIFIED_ONLY
- See Also:
- Constant Field Values
-
TRIM_ALL
public static final int TRIM_ALL
- See Also:
- Constant Field Values
-
columnNamesLineNum
public int columnNamesLineNum
Number of the line (1-based) containing field names (column captions).Default: 0
-
valuesStartLineNum
public int valuesStartLineNum
Number of the line (1-based) where actual data start after the header.Default: 1
-
detectColumnsMode
public int detectColumnsMode
The filter can detect number of columns in the input. This option specifies the way of columns number detection:- DETECT_COLUMNS_NONE = 0 - no detection is performed, if different rows contain different number of values, then different number of TUs will be sent for different rows
- DETECT_COLUMNS_COL_NAMES = 1 - number of columns is determined by the number of field names listed in the row specified by the fieldNamesRow parameter.
- DETECT_COLUMNS_FIXED_NUMBER = 2 - number of columns is explicitly specified by the numColumns parameter.
Default: DETECT_COLUMNS_NONE
-
numColumns
public int numColumns
Number of columns in the input. This option is active only if detectColumnsMode = DETECT_COLUMNS_FIXED_NUMBER.Extra columns are dropped, empty TUs are created for missing columns.
Default: 1
-
sendHeaderMode
public int sendHeaderMode
If there are one or more lines containing description of the data, names of fields etc., and actual data don't start in the first line, then such first lines are considered a header, and this option specifies how to handle them:- SEND_HEADER_NONE = 0 - none of the header lines are sent as text units
- SEND_HEADER_FIELD_NAMES_ONLY = 1 - only the values in the line specified by fieldNamesLineNum are sent as text units
- SEND_HEADER_ALL = 2 - values in all header lines are sent as text units
- See Also:
valuesStartLineNum,Default: SEND_HEADER_COLUMN_NAMES_ONLY
-
trimMode
public int trimMode
Specifies how field values are trimmed of spaces:- TRIM_NONE = 0 - field values are not trimmed
- TRIM_NONQUALIFIED_ONLY = 1 - only non-qualified field values are trimmed, leading and trailing spaces remain in qualified fields
- TRIM_ALL = 2 - both non-qualified and qualified field values are trimmed of leading and trailing spaces.
- See Also:
Default: TRIM_NONQUALIFIED_ONLY
-
sendColumnsMode
public int sendColumnsMode
Specifies values of which columns should be sent as text units- SEND_COLUMNS_NONE = 0 - none of the columns are sent as text units
- SEND_COLUMNS_LISTED = 1 - only values from the columns listed in idColumns, sourceColumns, targetColumns, commentColumns will be sent
- SEND_COLUMNS_ALL = 2 - values from all columns will be sent.
Default: SEND_COLUMNS_LISTED (send only columns listed in idColumns, sourceColumns, targetColumns, commentColumns)
-
recordIdColumn
public int recordIdColumn
Index (1-based) of the column containing an optional record ID (or a key) of the current row in the table.Default: 0
-
exposeCommentsAsMetadata
public boolean exposeCommentsAsMetadata
If true, expose values from commentColumns as trans-unit metadata (properties), rather than as notes. Default: false
-
sourceColumns
public String sourceColumns
Indicates which columns contain source text. If this list is empty, then all columns of the table will be considered containing source text to be extracted. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing source text
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing source text
Default: Empty
-
sourceIdColumns
public String sourceIdColumns
Indicates which columns contain source IDs. The source IDs become names of TU resources. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing a source ID
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing source IDs
Default: Empty
-
sourceIdSuffixes
public String sourceIdSuffixes
If there is the recordIdColumn index, and a source ID for the given column is not specified in the sourceIdColumns, then the source ID for that column is compiled of the value in recordIdColumn column, and the corresponding suffix in the sourceIdSuffixes. The source IDs become names of TU resources.Default: Empty
-
sourceIdSourceRefs
public String sourceIdSourceRefs
Indicates which source columns the source ID columns on the sourceIdSourceRefs list correspond to. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing source text
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing source text
Default: Empty
-
targetColumns
public String targetColumns
Indicates which columns contain target text. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing target text
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing target text
Default: Empty
-
targetSourceRefs
public String targetSourceRefs
Indicates which source columns the target columns on the targetColumns list correspond to. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing source text
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing source text
Default: Empty
-
targetLanguages
public String targetLanguages
Indicates which languages should be used in target columns. Can be represented by one of the following strings:- "fr" - target text in all target columns is French
- "fr, it, ge, fr" - target text in 1-st and 4-th columns is French, 2-nd - Italian, 3-rd - German
Default: Empty
-
commentColumns
public String commentColumns
Indicates which columns contain comments. Can be represented by one of the following string types:- "1" - index (1-based) of the column, containing a comment
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing comments
Default: Empty
-
commentSourceRefs
public String commentSourceRefs
Indicates which source columns the comment columns on the commentColumns list correspond to. The comment extracted from a comment column will become a read-only NOTE property of the corresponding source column referred. If you need a comment translated, list its column on the sourceColumns list. Can be represented by one of the following strings:- "1" - index (1-based) of the column, containing source text
- "1,2,5" - comma-delimited list (1-based) of indexes of the columns, containing source text.
Default: Empty
-
-
Method Detail
-
load
protected void load(ParametersString buffer)
Description copied from class:AbstractGroupParametersLoad from buffer. The protected buffer variable is visible in all subclasses of BaseParameters.- Overrides:
loadin classParameters
-
reset
public void reset()
Description copied from class:StringParametersReset this parameters object to its default values.Subclasses should override this method to set any initial values and instantiate any objects that require allocation. It is recommended that subclasses also call
super.reset()in the override to ensure that the buffer is empty.- Specified by:
resetin interfaceIParameters- Overrides:
resetin classParameters
-
save
protected void save(ParametersString buffer)
Description copied from class:AbstractGroupParametersSave to buffer. The protected buffer variable is visible in all subclasses of BaseParameters.- Overrides:
savein classParameters
-
-