Examples of STTaggerPOSDictionary


Examples of opennlp.ccg.parse.supertagger.util.STTaggerPOSDictionary

        throw new IOException("You must specify both a word-level dict and a POS dict.");
      }
      XMLWordDictionaryReader wdr = new XMLWordDictionaryReader(new File(wdictPath));
      XMLPOSDictionaryReader pdr = new XMLPOSDictionaryReader(new File(posdictPath));
      STTaggerWordDictionary wdict = wdr.read();
      STTaggerPOSDictionary posdict = pdr.read();
      hypertagger.wdict = wdict;
      hypertagger.posdict = posdict;
      String kstring = opts.get("dictk");
      if(kstring != null)
        hypertagger.dictK = Integer.parseInt(kstring);
View Full Code Here

Examples of opennlp.ccg.parse.supertagger.util.STTaggerPOSDictionary

            reader.setContentHandler(new wdContentHandler());
            reader.parse(this.dictFile.toURI().toString());
        } catch(Exception e) {
            e.printStackTrace();
        }
        return new STTaggerPOSDictionary(this.dict);
    }
View Full Code Here

Examples of opennlp.ccg.parse.supertagger.util.STTaggerPOSDictionary

    public static void main(String[] args) {
        // This is just to verify that the XML doc read in is the one
        // spit out.
        String fname = args[0];
        XMLPOSDictionaryReader rdr = new XMLPOSDictionaryReader(new File(fname));
        STTaggerPOSDictionary dct = rdr.read();
        Iterator<Pair<String, Collection<String>>> it = dct.getMappings();
        Pair<String, Collection<String>> tempP = null;
        System.out.println("<posdict>");
        while(it.hasNext()) {
            tempP = it.next();
            System.out.println("     <entry pos=\""+tempP.a+"\">");           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.