Package net.paoding.analysis.analyzer

Examples of net.paoding.analysis.analyzer.PaodingAnalyzer


  public static void main(String[] args) throws Exception {
    if (args.length != 0) {
      QUERY = args[0];
    }
    // 将庖丁封装成符合Lucene要求的Analyzer规范
    Analyzer analyzer = new PaodingAnalyzer();
   
    //读取本类目录下的text.txt文件
    String content = ContentReader.readText(Chinese.class);

    //接下来是标准的Lucene建立索引和检索的代码
View Full Code Here


  public static void main(String[] args) throws Exception {
    if (args.length != 0) {
      QUERY = args[0];
    }
    // 将庖丁封装成符合Lucene要求的Analyzer规范
    Analyzer analyzer = new PaodingAnalyzer();
   
    //读取本类目录下的text.txt文件
    String content = ContentReader.readText(English.class);

    //接下来是标准的Lucene建立索引和检索的代码
View Full Code Here

  public static void main(String[] args) throws Exception {
    if (args.length != 0) {
      QUERY = args[0];
    }
    // 将庖丁封装成符合Lucene要求的Analyzer规范
    Analyzer analyzer = new PaodingAnalyzer();
   
    //读取本类目录下的text.txt文件
    String content = ContentReader.readText(Chinese.class);

    //接下来是标准的Lucene建立索引和检索的代码
View Full Code Here

  public static void main(String[] args) throws Exception {
    if (args.length != 0) {
      QUERY = args[0];
    }
    // 将庖丁封装成符合Lucene要求的Analyzer规范
    Analyzer analyzer = new PaodingAnalyzer();
   
    //读取本类目录下的text.txt文件
    String content = ContentReader.readText(Chinese.class);

    //接下来是标准的Lucene建立索引和检索的代码
View Full Code Here

  public static void main(String[] args) throws Exception {
    if (args.length != 0) {
      QUERY = args[0];
    }
    // 将庖丁封装成符合Lucene要求的Analyzer规范
    Analyzer analyzer = new PaodingAnalyzer();
   
    //读取本类目录下的text.txt文件
    String content = ContentReader.readText(Chinese.class);

    //接下来是标准的Lucene建立索引和检索的代码
View Full Code Here

 
  private static void analysing() throws Exception {
    Analyzer analyzer;
    if (analyzerName == null || analyzerName.length() == 0 || analyzerName.equalsIgnoreCase("paoding")) {
      //properties==null等同于new new PaodingAnalyzer();
      analyzer = new PaodingAnalyzer(properties);
      if (mode != null) {
        ((PaodingAnalyzer) analyzer).setMode(mode);
      }
    }
    else {
View Full Code Here

 
  private static void analysing() throws Exception {
    Analyzer analyzer;
    if (analyzerName == null || analyzerName.length() == 0 || analyzerName.equalsIgnoreCase("paoding")) {
      //properties==null等同于new new PaodingAnalyzer();
      analyzer = new PaodingAnalyzer(properties);
      if (mode != null) {
        ((PaodingAnalyzer) analyzer).setMode(mode);
      }
    }
    else {
View Full Code Here

        if("zh".equals(language) || (language != null && language.length() > 4 &&
                language.charAt(2) == '-' && language.startsWith("zh"))){
            if(label.isEmpty()){
                return EMPTY;
            }
            PaodingAnalyzer pa;
            try {
                pa = AccessController.doPrivileged(new PrivilegedExceptionAction<PaodingAnalyzer>() {
                    public PaodingAnalyzer run() throws Exception {
                        return new PaodingAnalyzer();
                    }
                });
            } catch (PrivilegedActionException pae){
                Exception e = pae.getException();
                log.error("Unable to initialise PoadingAnalyzer",e);
                return null;
            }
            TokenStream ts = pa.tokenStream("dummy", new StringReader(label));
            List<String> tokens = new ArrayList<String>(8);
            int lastEnd = 0;
            try {
                while(ts.incrementToken()){
                    OffsetAttribute offset = ts.addAttribute(OffsetAttribute.class);
View Full Code Here

                + "As this is also checked within the #canEnhance(..) method this "
                + "indicates an Bug in the used EnhancementJobManager implementation. "
                + "Please report this on the dev@apache.stanbol.org or create an "
                + "JIRA issue about this.");
        }
        PaodingAnalyzer pa;
        try {
            pa = AccessController.doPrivileged(new PrivilegedExceptionAction<PaodingAnalyzer>() {
                public PaodingAnalyzer run() throws Exception {
                    return new PaodingAnalyzer();
                }
            });
        } catch (PrivilegedActionException pae){
            Exception e = pae.getException();
            log.error("Unable to initialise PoadingAnalyzer",e);
            throw new EngineException("Unable to initialise PoadingAnalyzer",e);
        }
        TokenStream ts = pa.tokenStream("dummy", new CharSequenceReader(at.getText()));
        int lastEnd = 0;
        try {
            while(ts.incrementToken()){
                OffsetAttribute offset = ts.addAttribute(OffsetAttribute.class);
                //when tokenizing labels we need to preserve all chars
View Full Code Here

TOP

Related Classes of net.paoding.analysis.analyzer.PaodingAnalyzer

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.