1. muzny
  2. WiktionaryIdioms

Commits

muzny  committed 005d62b

Comments on Example, ExampleUtilities

  • Participants
  • Parent commits ba95de7
  • Branches master

Comments (0)

Files changed (2)

File WiktionaryIdioms/src/detector/model/Example.java

View file
  * A model for an example. An example has a class label, a title 
  * (phrase that it is listed under), text (the example sentence),
  * and JWKTL key (corresponding to the sense it is listed under).
+ * 
+ * Examples are ClassifierData. This means that this framework is set up
+ * so that if you wanted to try to directly classify examples, you could do
+ * that.
  */
 
 package detector.model;

File WiktionaryIdioms/src/detector/utilities/ExampleUtilities.java

View file
+/**
+ * A small utilities class to do things with examples.
+ * Currently knows how to get examples out of a database
+ * and read examples from a file.
+ */
+
 package detector.utilities;
 
 import java.io.File;
 public class ExampleUtilities {
 	public static final int STEP_SIZE = 100000;
 
+	/**
+	 * Gets examples from a MySQL database, with the columns "sense_key", "title",
+	 * "text", and "labelKind".
+	 * @param database - Database to draw from.
+	 * @param table - Table to draw from.
+	 * @param whereClause - Any limiting parameters you want on the SQL query.
+	 * @param labelKind - What column the label is listed under.
+	 * @return List of ClassifierData (that are Examples).
+	 */
 	public static List<ClassifierData> getExamplesFromDb(
 			String database, String table, String whereClause, String labelKind) {
 		
 	}
 	
 	/**
-	 * Currently has a limit of only reading the first 1,000,000 lines.
-	 * @param f
-	 * @return
+	 * Currently has a limit of only reading the first 1,000,000 lines of a file.
+	 * Depends on the file being in the format:
+	 * sense_key |||| title |||| text |||| label |||| feat1num:val1 feat2num:val2 ....
+	 * @param f - File to read examples from.
+	 * @return List of ClassifierData(Examples) gathered from the file.
 	 */
 	public static List<ClassifierData> getExamplesFromFile(File f) {
 		List<ClassifierData> results = new ArrayList<ClassifierData>();