Examples of Srx2SaxParser


Examples of net.sourceforge.segment.srx.io.Srx2SaxParser

    try {
      srxReader = new BufferedReader(new InputStreamReader(
              JLanguageTool.getDataBroker().getFromResourceDirAsStream(RULES), "utf-8"));
      final Map<String, Object> parserParameters = new HashMap<>();
      parserParameters.put(Srx2SaxParser.VALIDATE_PARAMETER, true);
      final SrxParser srxParser = new Srx2SaxParser(parserParameters);
      final SrxDocument document = srxParser.parse(srxReader);
      return document;
    } catch (IOException e) {
      throw new RuntimeException("Could not load rules " + RULES + " from resource dir "
              + JLanguageTool.getDataBroker().getResourceDir(), e);
    } finally {
View Full Code Here

Examples of net.sourceforge.segment.srx.io.Srx2SaxParser

    BufferedReader srxReader = null;
    try {
      srxReader = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));
      Map<String, Object> parserParameters = new HashMap<>();
      parserParameters.put(Srx2SaxParser.VALIDATE_PARAMETER, true);
      SrxParser srxParser = new Srx2SaxParser(parserParameters);
      return srxParser.parse(srxReader);
    } catch (IOException e) {
      throw new RuntimeException("Could not load rules from resource dir "
              + JLanguageTool.getDataBroker().getResourceDir(), e);
    } finally {
      closeQuietly(srxReader);
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.