Examples of DictionaryFileParserImpl


Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

      InputStream stream = new BufferedInputStream(
            new FileInputStream(dictFile));

      DictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);

      Dictionary dict = dictBuilder.getDictionary();

      // -- read input XCAS and create a CAS --
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

               MESSAGE_DIGEST, "dictionary_annotator_filter_feature_condition",
               new Object[] { buffer.toString() });
      }

      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();

      // get UIMA datapath and tokenize it into its elements
      StringTokenizer tokenizer = new StringTokenizer(getContext()
            .getDataPath(), PATH_SEPARATOR);
      ArrayList<File> datapathElements = new ArrayList<File>();
      while (tokenizer.hasMoreTokens()) {
         // add datapath elements to the 'datapathElements' array list
         datapathElements.add(new File(tokenizer.nextToken()));
      }

      // parse dictionary files
      ArrayList<Dictionary> dicts = new ArrayList<Dictionary>();
      for (int i = 0; i < dictionaryFileNames.length; i++) {
         // try to resolve the relative file name with classpath or datapath
         DictionaryFile file = resolveRelativeFilePath(dictionaryFileNames[i],
               datapathElements);

         // if the current dictionary file wasn't found, throw an exception
         if (file == null) {
            throw new DictionaryAnnotatorConfigException(
                  "dictionary_annotator_resource_not_found",
                  new Object[] { dictionaryFileNames[i] });
         } else {
            // log concept file path
            this.logger.logrb(Level.CONFIG, "DictionaryAnnotator",
                  "initialize", MESSAGE_DIGEST,
                  "dictionary_annotator_dictionary_file", new Object[] { file
                        .getFilePath() });

            // parse dictionary file
            Dictionary dict = fileParser.parseDictionaryFile(
                  file.getFilePath(), file.getStream(), new HashMapDictionaryBuilder());
            // add dictionary to the dictionary list
            dicts.add(dict);
         }
      }
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);
      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      // read dictionary entries
      ArrayList<String> entries = getDictionaryEntries(dictFile);
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      DictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);

      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      // read dictionary entries
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);
      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      // read dictionary entries
      ArrayList<String> entries = getDictionaryEntries(dictFile);
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);
      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      // read dictionary entries
      ArrayList<String> entries = getDictionaryEntries(dictFile);
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);
      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      // read dictionary entries
      ArrayList<String> entries = getDictionaryEntries(dictFile);
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();

      boolean foundMessage = false;

      try {
         fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
               dictBuilder);
      } catch (DictionaryAnnotatorConfigException ex) {
         String message = ex.getMessage();
         if (message.indexOf("InvalidDictFile.xml") > -1) {
            foundMessage = true;
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();

      boolean foundMessage = false;

      try {
         fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
               dictBuilder);
      } catch (DictionaryAnnotatorConfigException ex) {
         String message = ex.getMessage();
         if (message.indexOf("InvalidDictFile2.xml") > -1) {
            foundMessage = true;
View Full Code Here

Examples of org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryFileParserImpl

            new FileInputStream(dictFile));

      // create dictionary
      HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
      // create dictionary file parser
      DictionaryFileParser fileParser = new DictionaryFileParserImpl();
      fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
            dictBuilder);
      HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();

      //create dictionary content output file
      File outputFile = new File(JUnitExtension
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.