Class Parameters
- java.lang.Object
-
- net.sf.okapi.common.BaseParameters
-
- net.sf.okapi.common.StringParameters
-
- net.sf.okapi.filters.multiparsers.Parameters
-
- All Implemented Interfaces:
IParameters,IEditorDescriptionProvider
public class Parameters extends StringParameters implements IEditorDescriptionProvider
-
-
Field Summary
Fields Modifier and Type Field Description static StringCSV_AUTODETECTCOLUMNTYPESstatic StringCSV_AUTODETECTCOLUMNTYPESROWstatic StringCSV_FORMATCOLSstatic StringCSV_NOEXTRACTCOLSstatic StringCSV_STARTINGROW-
Fields inherited from class net.sf.okapi.common.StringParameters
buffer
-
Fields inherited from class net.sf.okapi.common.BaseParameters
path
-
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EditorDescriptioncreateEditorDescription(ParametersDescription paramDesc)booleangetCsvAutoDetectColumnTypes()Gets the detection mode used when determining each column's extraction type.intgetCsvAutoDetectColumnTypesRow()Gets the row number to use when using 'auto-detection' to determine column types.StringgetCsvFormatCols()Gets the comma-separated list of the indexes of the columns to process with a non-plain-text filter (0-based index).StringgetCsvNoExtractCols()Gets the comma-separated list of the indexes of the columns not to extract (0-based index).intgetCsvStartingRow()Gets the row number where the extraction should start (1-based index).ParametersDescriptiongetParametersDescription()Gets the description of the parameters.voidreset()Reset this parameters object to its default values.voidsetCsvAutoDetectColumnTypes(boolean csvAutoDetectColumnTypes)voidsetCsvAutoDetectColumnTypesRow(int csvAutoDetectColumnTypesRow)voidsetCsvFormatCols(String csvFormatCols)voidsetCsvNoExtractCols(String csvNoExtractCols)voidsetCsvStartingRow(int csvStartingRow)-
Methods inherited from class net.sf.okapi.common.StringParameters
fromString, fromString, getBoolean, getGroup, getInteger, getString, setBoolean, setGroup, setInteger, setString, toString
-
-
-
-
Field Detail
-
CSV_NOEXTRACTCOLS
public static final String CSV_NOEXTRACTCOLS
- See Also:
- Constant Field Values
-
CSV_FORMATCOLS
public static final String CSV_FORMATCOLS
- See Also:
- Constant Field Values
-
CSV_STARTINGROW
public static final String CSV_STARTINGROW
- See Also:
- Constant Field Values
-
CSV_AUTODETECTCOLUMNTYPES
public static final String CSV_AUTODETECTCOLUMNTYPES
- See Also:
- Constant Field Values
-
CSV_AUTODETECTCOLUMNTYPESROW
public static final String CSV_AUTODETECTCOLUMNTYPESROW
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 classStringParameters
-
getCsvNoExtractCols
public String getCsvNoExtractCols()
Gets the comma-separated list of the indexes of the columns not to extract (0-based index). You can have whitespace between values. Example: "2,4"- Returns:
- the comma-separated list of the columns not to extract, or null when all columns are extractable.
-
setCsvNoExtractCols
public void setCsvNoExtractCols(String csvNoExtractCols)
-
getCsvFormatCols
public String getCsvFormatCols()
Gets the comma-separated list of the indexes of the columns to process with a non-plain-text filter (0-based index). The format to use for the given column is entered after the index and a separator ':'. You can have whitespace between values. Example: "1:okf_markdown, 5:okf_html"- Returns:
- the comma-separated list of the columns to process with a given sub-filter, null when all columns are plain-text.
-
setCsvFormatCols
public void setCsvFormatCols(String csvFormatCols)
-
getCsvStartingRow
public int getCsvStartingRow()
Gets the row number where the extraction should start (1-based index).- Returns:
- the row number where the extraction should start.
-
setCsvStartingRow
public void setCsvStartingRow(int csvStartingRow)
-
getCsvAutoDetectColumnTypes
public boolean getCsvAutoDetectColumnTypes()
Gets the detection mode used when determining each column's extraction type. 'False' to use values in the .fprm file, 'true' to auto-detect the extraction types for each column using the designated row in the CSV. This auto-detect row might look like this: "notrans,text,okf_html,okf_markdown,text".- Returns:
- boolean value which governs the auto-detection mode.
-
setCsvAutoDetectColumnTypes
public void setCsvAutoDetectColumnTypes(boolean csvAutoDetectColumnTypes)
-
getCsvAutoDetectColumnTypesRow
public int getCsvAutoDetectColumnTypesRow()
Gets the row number to use when using 'auto-detection' to determine column types. The auto-detection row might look like this: "notrans,text,okf_html,okf_markdown,text".- Returns:
- int value corresponding to the line/row number containing the "column types" data
-
setCsvAutoDetectColumnTypesRow
public void setCsvAutoDetectColumnTypesRow(int csvAutoDetectColumnTypesRow)
-
getParametersDescription
public ParametersDescription getParametersDescription()
Description copied from interface:IParametersGets the description of the parameters.- Specified by:
getParametersDescriptionin interfaceIParameters- Overrides:
getParametersDescriptionin classBaseParameters- Returns:
- the ParametersDescription object for this set of parameters, or null if none is provided.
-
createEditorDescription
public EditorDescription createEditorDescription(ParametersDescription paramDesc)
- Specified by:
createEditorDescriptionin interfaceIEditorDescriptionProvider
-
-