InstructionFilterPostProcessor.java
Go to the documentation of this file.
00001 package instruction.postprocessor;
00002 
00003 import instruction.semanticObjects.Action;
00004 import instruction.semanticObjects.Instruction;
00005 import instruction.semanticObjects.Word;
00006 import instruction.wordnet.WordNetRDF2;
00007 
00008 import java.util.List;
00009 
00010 public class InstructionFilterPostProcessor implements PostProcessor {
00011 
00012         public void run( List<Instruction> instructions ) {
00013 
00014                 for ( int i = 0; i < instructions.size(); i++ ) {
00015                         Instruction cur = instructions.get( i );
00016                         Action a = cur.getAction();
00017                         try {
00018                                 if ( ! WordNetRDF2.wordExactlyExistsAs( a.getAction().getLabel(), WordNetRDF2.convertPOS(Word.TYPE_VERB_INFINITIVE) ) ) {
00019                                 //      System.out.println("Word " + a.getAction().getLabel() + " not found in WordNet");
00020                                         instructions.remove( cur );
00021                                         i -= 1;
00022                                         continue;
00023                                 }
00024                         }
00025                         catch ( Exception e ) {
00026                                 System.out.println( e.getMessage() );
00027                                 instructions.remove( cur );
00028                                 i -= 1;
00029                                 continue;
00030                         }
00031                 }
00032         }
00033 
00034 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


comp_ehow
Author(s): Moritz Tenorth, Daniel Nyga
autogenerated on Tue Apr 16 2013 00:18:02