类 TextDirectoryLoader
java.lang.Object
weka.core.converters.AbstractLoader
weka.core.converters.TextDirectoryLoader
- 所有已实现的接口:
Serializable
,BatchConverter
,Loader
,OptionHandler
,RevisionHandler
Loads all text files in a directory and uses the subdirectory names as class labels. The content of the text files will be stored in a String attribute, the filename can be stored as well.
Valid options are:
-D Enables debug output. (default: off)
-F Stores the filename in an additional attribute. (default: off)
-dir <directory> The directory to work on. (default: current directory)Based on code from the TextDirectoryToArff tool:
-
字段概要
从接口继承的字段 weka.core.converters.Loader
BATCH, INCREMENTAL, NONE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明the tip text for this propertythe tip text for this propertyGet the character set to use when reading text files.Return the full data set.boolean
getDebug()
Gets whether additional debug information is printed.get the Dir specified as the sourceReturns a description of the file type, actually it's directories.getNextInstance
(Instances structure) TextDirectoryLoader is unable to process a data set incrementally.String[]
Gets the settingboolean
Gets whether the filename will be stored as an extra attribute.Returns the revision string.Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances.Returns a string describing this loaderLists the available optionsstatic void
Main method.the tip text for this propertyvoid
reset()
Resets the loader ready to read a new data setvoid
setCharSet
(String charSet) Set the character set to use when reading text files (an empty string indicates that the default character set will be used).void
setDebug
(boolean value) Sets whether to print some debug information.void
setDirectory
(File dir) sets the source directoryvoid
setOptions
(String[] options) Parses a given list of options.void
setOutputFilename
(boolean value) Sets whether the filename will be stored as an extra attribute.void
Resets the Loader object and sets the source of the data set to be the supplied File object.从类继承的方法 weka.core.converters.AbstractLoader
setRetrieval, setSource
-
构造器详细资料
-
TextDirectoryLoader
public TextDirectoryLoader()default constructor
-
-
方法详细资料
-
globalInfo
Returns a string describing this loader- 返回:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
listOptions
Lists the available options- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of the available options
-
setOptions
Parses a given list of options. Valid options are:-D Enables debug output. (default: off)
-F Stores the filename in an additional attribute. (default: off)
-dir <directory> The directory to work on. (default: current directory)
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the options- 抛出:
Exception
- if options cannot be set
-
getOptions
Gets the setting- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- the current setting
-
charSetTipText
the tip text for this property- 返回:
- the tip text
-
setCharSet
Set the character set to use when reading text files (an empty string indicates that the default character set will be used).- 参数:
charSet
- the character set to use.
-
getCharSet
Get the character set to use when reading text files. An empty string indicates that the default character set will be used.- 返回:
- the character set name to use (or empty string to indicate that the default character set will be used).
-
setDebug
public void setDebug(boolean value) Sets whether to print some debug information.- 参数:
value
- if true additional debug information will be printed.
-
getDebug
public boolean getDebug()Gets whether additional debug information is printed.- 返回:
- true if additional debug information is printed
-
debugTipText
the tip text for this property- 返回:
- the tip text
-
setOutputFilename
public void setOutputFilename(boolean value) Sets whether the filename will be stored as an extra attribute.- 参数:
value
- if true the filename will be stored in an extra attribute
-
getOutputFilename
public boolean getOutputFilename()Gets whether the filename will be stored as an extra attribute.- 返回:
- true if the filename is stored in an extra attribute
-
outputFilenameTipText
the tip text for this property- 返回:
- the tip text
-
getFileDescription
Returns a description of the file type, actually it's directories.- 返回:
- a short file description
-
getDirectory
get the Dir specified as the source- 返回:
- the source directory
-
setDirectory
sets the source directory- 参数:
dir
- the source directory- 抛出:
IOException
- if an error occurs
-
reset
public void reset()Resets the loader ready to read a new data set- 指定者:
reset
在接口中Loader
- 覆盖:
reset
在类中AbstractLoader
-
setSource
Resets the Loader object and sets the source of the data set to be the supplied File object.- 指定者:
setSource
在接口中Loader
- 覆盖:
setSource
在类中AbstractLoader
- 参数:
dir
- the source directory.- 抛出:
IOException
- if an error occurs
-
getStructure
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances.- 指定者:
getStructure
在接口中Loader
- 指定者:
getStructure
在类中AbstractLoader
- 返回:
- the structure of the data set as an empty set of Instances
- 抛出:
IOException
- if an error occurs
-
getDataSet
Return the full data set. If the structure hasn't yet been determined by a call to getStructure then method should do so before processing the rest of the data set.- 指定者:
getDataSet
在接口中Loader
- 指定者:
getDataSet
在类中AbstractLoader
- 返回:
- the structure of the data set as an empty set of Instances
- 抛出:
IOException
- if there is no source or parsing fails
-
getNextInstance
TextDirectoryLoader is unable to process a data set incrementally.- 指定者:
getNextInstance
在接口中Loader
- 指定者:
getNextInstance
在类中AbstractLoader
- 参数:
structure
- ignored- 返回:
- never returns without throwing an exception
- 抛出:
IOException
- always. TextDirectoryLoader is unable to process a data set incrementally.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
Main method.- 参数:
args
- should contain the name of an input file.
-