|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectace.datatypes.Project
public class Project
Objects of this class each hold reference to the componant ACE XML files and other characteristics of an ACE XML project file. This class contains methods to save and parse an ACE XML project file.
The ACE XML project file is one of the ACE XML file formats. Its main purpose is to provide the user with an easy, single step way of loading a previously saved ACE project. Without this project file, the user would have to individually load each the taxonomy file, feature vectors file, feature definitions file, and classifications file. The ACE XML project file format is designed to contain references to all componant ACE XML files of an ACE project. Thus the user can simply load an ACE project file, and ACE can load each of the individual component files internally without the user ever having to explicitly specify them. This project file is also used in the context of an ACE Zip File. In this case, the project file contains reference to the ACE XML files compressed in the zipfile. Note that with an ACE project file, only reference to the component ACE XML files are stored, not the actual files themselves, therefore the files themselves must be stored in a location that ACE can access.
The following is an example of an ACE XML project file:
<?xml version="1.0"?>
<!DOCTYPE ace_project_file [
<!ELEMENT ace_project_file (comments, taxonomy_path, feature_definitions_path, feature_vectors_path, model_classifications_path, gui_preferences_path, classifier_settings_path, trained_classifiers_path, weka_arff_path)>
<!ELEMENT comments (#PCDATA)>
<!ELEMENT taxonomy_path (#PCDATA)>
<!ELEMENT feature_definitions_path (path*)>
<!ELEMENT feature_vectors_path (path*)>
<!ELEMENT model_classifications_path (path*)>
<!ELEMENT gui_preferences_path (#PCDATA)>
<!ELEMENT classifier_settings_path (#PCDATA)>
<!ELEMENT trained_classifiers_path (#PCDATA)>
<!ELEMENT weka_arff_path (#PCDATA)>
<!ELEMENT path (#PCDATA)>
]>
<ace_project_file>
  <comments>this is a comment</comments>
  <taxonomy_path>/jMIR/ACE/ADDITIONAL_FILES/TestFiles/Taxonomy.xml</taxonomy_path>
  <feature_definitions_path>
    <path>/jMIR/ACE/ADDITIONAL_FILES/TestFiles/FeatureKey.xml</path>
  </feature_definitions_path>
  <feature_vectors_path>
    <path>/jMIR/ACE/ADDITIONAL_FILES/TestFiles/FeatureVectors.xml</path>
  </feature_vectors_path>
  <model_classifications_path>
    <path>/jMIR/ACE/ADDITIONAL_FILES/TestFiles/Classifications.xml</path>
  </model_classifications_path>
  <gui_preferences_path></gui_preferences_path>
  <classifier_settings_path></classifier_settings_path>
  <trained_classifiers_path></trained_classifiers_path>
  <weka_arff_path></weka_arff_path>
</ace_project_file>
Field Summary | |
---|---|
java.lang.String[] |
classification_paths
Array of paths to the ACE XML classification files that hold model classifications for instances. |
java.lang.String |
classifier_settings_path
Path to the current classifier_settings_file that holds preferences for use in training and testing classifiers. |
java.lang.String |
comments
Comments concerning this ACE project to be included in the ACE XML project file with the <comments> tag. |
java.lang.String[] |
feature_settings_paths
Array of paths to the ACE XML feature key/definition files that contain information about the features to be used for this ACE project. |
java.lang.String[] |
feature_vectors_paths
Array of paths to the ACE XML feature vector files that hold extracted feature values for an ACE project. |
java.lang.String |
gui_preferences_path
Path to the current gui_preferences_file. |
java.lang.String |
taxonomy_path
Path to the ACE XML taxonomy file for this project. |
java.lang.String |
trained_classifiers_path
Path of the current trained_classifiers_file that holds a set of trained classifiers. |
java.lang.String |
weka_arff_path
Specifies the path to the weka arff file from which instances will be loaded. |
Constructor Summary | |
---|---|
Project()
Constructs an instance of a Project. |
|
Project(java.lang.String comments,
java.lang.String taxonomy_path,
java.lang.String[] feature_settings_paths,
java.lang.String[] feature_vectors_paths,
java.lang.String[] classification_paths,
java.lang.String gui_preferences_path,
java.lang.String classifier_settings_path,
java.lang.String trained_classifiers_path,
java.lang.String weka_arff_path)
Constructs an instance of a Project. |
Method Summary | |
---|---|
void |
addClassification(java.lang.String new_classification)
|
void |
addDataSet(java.lang.String new_dataset)
|
void |
addFeatureDefinition(java.lang.String new_feature_definition)
|
void |
addTaxonomy(java.lang.String new_taxonomy)
|
void |
parseProjectFile(java.lang.String selected_project_file)
Given an ACE XML project file, this method sets the fields of this class equal to the paths specified in the project file. |
java.lang.String |
saveProjectFile(java.lang.String project_name,
boolean can_erase)
This method saves the ACE XML project file using the fields of an instance of a Project instead of specifying the values explicitly in the parameters. |
static java.lang.String |
saveProjectFile(java.lang.String path,
boolean can_erase,
java.lang.String comments,
java.lang.String taxonomy_path,
java.lang.String[] feature_settings_paths,
java.lang.String[] feature_vectors_paths,
java.lang.String[] classification_paths,
java.lang.String gui_preferences_path,
java.lang.String classifier_settings_path,
java.lang.String trained_classifiers_path,
java.lang.String weka_arff_path)
Creates, writes to, and saves an ACE XML project file. |
void |
saveUnzippedProjectFile(java.lang.String directory_path,
java.lang.String project_name)
Changes the path names specified in the ACE XML project file to reflect the new location of the unzipped files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String comments
public java.lang.String taxonomy_path
public java.lang.String[] feature_settings_paths
public java.lang.String[] feature_vectors_paths
public java.lang.String[] classification_paths
public java.lang.String gui_preferences_path
public java.lang.String classifier_settings_path
public java.lang.String trained_classifiers_path
public java.lang.String weka_arff_path
Constructor Detail |
---|
public Project(java.lang.String comments, java.lang.String taxonomy_path, java.lang.String[] feature_settings_paths, java.lang.String[] feature_vectors_paths, java.lang.String[] classification_paths, java.lang.String gui_preferences_path, java.lang.String classifier_settings_path, java.lang.String trained_classifiers_path, java.lang.String weka_arff_path)
All fields are initialized to the values given as parameters.
comments
- Comments concerning the ACE XML project file.taxonomy_path
- Path to the current taxonomy file that contains the taxonomy that the user
wishes to use.feature_settings_paths
- Arrray of paths to the feature key/settings XML files that hold the details about the
features to be used for an ACE project.feature_vectors_paths
- Array of paths to the feature vector XML files that hold extracted feature
values for an ACE project.classification_paths
- Array of paths to the classification XML files that hold model
classifications for instances.gui_preferences_path
- Path of the current gui_preferences_file that holds preferences for the GUI.classifier_settings_path
- Path of the current classifier_settings_file that holds preferences for
use in training and testing classifiers.trained_classifiers_path
- Path of the current trained_classifiers_file that holds a set of trained
classifiers.weka_arff_path
- Specifies the path to the weka arff file that the user wants to use in place of ACE XML files.public Project()
All fields are initialized to null.
Method Detail |
---|
public void parseProjectFile(java.lang.String selected_project_file) throws java.lang.Exception
selected_project_file
- Specifies the path to the ACE XML Project
file that the user wishes to parse.
java.lang.Exception
- If an error occurs.public static java.lang.String saveProjectFile(java.lang.String path, boolean can_erase, java.lang.String comments, java.lang.String taxonomy_path, java.lang.String[] feature_settings_paths, java.lang.String[] feature_vectors_paths, java.lang.String[] classification_paths, java.lang.String gui_preferences_path, java.lang.String classifier_settings_path, java.lang.String trained_classifiers_path, java.lang.String weka_arff_path) throws java.lang.Exception
path
- This will be the name of the saved XML project file.can_erase
- Specifies whether or not a previously existing file with the same name should be overwritten or not.
If false, it will send a prompt to the user asking if they would like to overwrite the previously existing file.
If true, it will overwrite any previously existing files with the same name automatically.comments
- Comments concerning the ACE XML project file.taxonomy_path
- Path to the current taxonomy file that contains the taxonomy that the user
wishes to use.feature_settings_paths
- Arrray of paths to the feature key/settings XML files that hold the details about the
features to be used for an ACE project.feature_vectors_paths
- Array of paths to the feature vector XML files that hold extracted feature
values for an ACE project.classification_paths
- Array of paths to the classification XML files that hold model
classifications for instances.gui_preferences_path
- Path of the current gui_preferences_file that holds preferences for the GUI.classifier_settings_path
- Path of the current classifier_settings_file that holds preferences for
use in training and testing classifiers.trained_classifiers_path
- Path of the current trained_classifiers_file that holds a set of trained
classifiers.weka_arff_path
- Specifies the path to the weka arff file that the user wants to use in place of ACE XML files.
java.lang.Exception
- If unable to save the file.public java.lang.String saveProjectFile(java.lang.String project_name, boolean can_erase) throws java.lang.Exception
It simply calls the above saveProjectFile method using the fields of this instance of a Project as parameters.
project_name
- This will be the name of the saved ACE XML project file.can_erase
- Specifies whether or not a previously existing file with the same name should be overwritten or not.
If false, it will send a prompt to the user asking if they would like to overwrite the previously existing file.
If true, it will overwrite any previously existing files with the same name automatically.
java.lang.Exception
- If a problem is encountered.public void saveUnzippedProjectFile(java.lang.String directory_path, java.lang.String project_name) throws java.lang.Exception
After a project that is being loaded from a zipfile has been unzipped, this method rewrites the ACE XML project file so that it specifies the paths to the newly unzipped ACE XML files in their new directory instead of the pre-zippage file paths. This becomes relevant when the user wishes load a project from a zip file, or for extracting and adding individual ACE XML files to a zip file. New paths will be absolute paths.
directory_path
- Specifies the path to the directory to which the zipped files were extracted.
In the new project file, pathnames will be specified in the format: directory_path + separator + previously specified file nameproject_name
- Specifies the name of the ACE XML file that is being rewritten.
java.lang.Exception
- If an error occurs.public void addTaxonomy(java.lang.String new_taxonomy)
public void addDataSet(java.lang.String new_dataset)
public void addFeatureDefinition(java.lang.String new_feature_definition)
public void addClassification(java.lang.String new_classification)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |