Commits

muzny committed 68770ff

FileIO comments

Comments (0)

Files changed (9)

WiktionaryIdioms/src/fileio/CompareAnnotations.java

+/**
+ * A main class for comparing and analyzing different annotations files.
+ * These are files that are produced by the EditableFile class and that have
+ * been fully annotated. Will throw an error if any examples in the annotations
+ * files lack a corrected label.
+ */
+
 package fileio;
 
 import java.io.File;

WiktionaryIdioms/src/fileio/EditableFile.java

+/**
+ * An implementation of ProducesFile that produces a file for annotating
+ * senses.
+ */
+
+
 package fileio;
 
 import java.util.ArrayList;
 import mysql.utilities.MySQLConnection;
 
 
-
 public class EditableFile implements ProducesFile {
 
 	@Override
+	/**
+	 * An implementation of ProducesFile that produces a file for annotating
+	 * senses.
+	 */
 	public String produce(ProduceFileSettings settings) {
 		List<String> whatToSelect = new ArrayList<String>();
 		whatToSelect.add("sense_key");

WiktionaryIdioms/src/fileio/PlainExamplesFile.java

 package fileio;
 
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import mysql.utilities.MySQLConnection;
 
-import classifier.features.numeric.Feature;
-import classifier.model.Sense;
 import detector.model.Example;
 
 
 	public static final int STEP_SIZE = 100000;
 
 	@Override
+	/**
+	 * Produces a string that represents a file that contains the specified examples.
+	 * Specifically designed to produce a file to be read by RunDetectorExperimentFromFiles.
+	 */
 	public String produce(ProduceFileSettings settings) {
 		List<String> whatToSelect = new ArrayList<String>();
 		whatToSelect.add("sense_key");

WiktionaryIdioms/src/fileio/PlainSensesFile.java

 public class PlainSensesFile implements ProducesFile {
 
 	@Override
+	/**
+	 * Produces a string that represents a file that contains the specified senses.
+	 * Specifically designed to produce a file to be read by RunClassifierExperimentFromFiles.
+	 * Also works for producing the necessary all senses file for RunDetectorExperimentFromFiles.
+	 */
 	public String produce(ProduceFileSettings settings) {
 		List<String> whatToSelect = new ArrayList<String>();
 		whatToSelect.add("sense_key");

WiktionaryIdioms/src/fileio/ProduceFile.java

 /**
+ * The main class to access all ProducesFiles implementors from.
+ * 
  * Provides an interface to the database to produce text files from it.
  * Parameters are as follows:
  * -outfile: the path the the output file

WiktionaryIdioms/src/fileio/ProduceFileSettings.java

+/**
+ * The wrapper for an object of settings used by the various
+ * ProduceFile classes.
+ */
+
 package fileio;
 
 import java.util.Set;

WiktionaryIdioms/src/fileio/ProducesFile.java

+/**
+ * Interface to ProducesFiles objects, that know how to read the settings
+ * and correspondingly produce a string to be output to a file.
+ */
+
 package fileio;
 
 import java.util.TreeMap;

WiktionaryIdioms/src/fileio/RandomSampleFile.java

 /**
- * WARNING: this file has not been updated since the last changes were made to ProduceFile
+ * WARNING: this file has not been updated since the last changes were made to ProduceFile,
+ * and may have issues stopping.
  */
 
 

WiktionaryIdioms/src/fileio/ReadCorrectedLabels.java

+/**
+ * Reads a corrected annotation file back into a MySQL table.
+ * Updates the "comments" and "corrected_label" columns.
+ */
+
 package fileio;
 
 import java.io.File;