Package opennlp.ccg.grammar

Examples of opennlp.ccg.grammar.Grammar


 
  @Before
  @SuppressWarnings("deprecation")
  public void setUp() throws Exception {
    if(grammar == null) {
      grammar = new Grammar(new File(new File(
          new File(System.getProperty("user.dir")), "test"),
          "grammar.xml").toURL());
    }
  }
View Full Code Here


    Map<String,Sign> signMap = new HashMap<String,Sign>();

        // load grammar
        URL grammarURL = new File(grammarfile).toURI().toURL();
        System.out.println("Loading grammar from URL: " + grammarURL);
        Grammar grammar = new Grammar(grammarURL);
        Tokenizer tokenizer = grammar.lexicon.tokenizer;
        System.out.println();
       
        // set up parser
        Parser parser = new Parser(grammar);
View Full Code Here

  // constructor
  public Testbed(Set<CCGBankTaskSources> sourcesSet, File targetDirectory,
      CCGBankTaskTestbed testbed) throws IOException {
    grammarFile = new File(targetDirectory, "grammar.xml");

    this.grammar = new Grammar(grammarFile.toURI().toURL(), true);
    this.lexicon = grammar.lexicon;
    this.rules = grammar.rules;

    this.sourcesSet = sourcesSet;
    this.targetDirectory = targetDirectory;
View Full Code Here

    }
    catch (MalformedURLException e1) {
      e1.printStackTrace();
    }
    try {
      grammar = new Grammar(grammarURL);
    }
    catch (Exception e) {
      e.printStackTrace();
    }
    lfFiles = new ArrayList<File>();
View Full Code Here

        }
       
        // load grammar
        URL grammarURL = new File(grammarfn).toURI().toURL();
        System.out.println("Loading grammar from URL: " + grammarURL);
        Grammar grammar = new Grammar(grammarURL);
       
        // load model
        System.out.println("Loading syntactic model from: " + dir);
        topfn = dir + "/" + topfn; leaffn = dir + "/" + leaffn; unaryfn = dir + "/" + unaryfn; binaryfn = dir + "/" + binaryfn;
        GenerativeSyntacticModel model = new GenerativeSyntacticModel(topfn, leaffn, unaryfn, binaryfn);
View Full Code Here

        }
       
        // load grammar
        URL grammarURL = new File(grammarfile).toURI().toURL();
        System.out.println("Loading grammar from URL: " + grammarURL);
        tester.grammar = new Grammar(grammarURL);
        System.out.println();
       
        // with -aanfilter (<excfile) option, instantiate AAnFilter
        AAnFilter aanFilter = null;
        if (aanfilter) {
View Full Code Here

TOP

Related Classes of opennlp.ccg.grammar.Grammar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.