Examples of LuceneManager


Examples of de.innovationgate.wgpublisher.lucene.LuceneManager

     */
    private WGResultSet executeLuceneQuery(WGDatabase db, QueryData queryData, Map parameters) {
       
        Status status = (Status) getStatus();
       
        LuceneManager manager = getCore().getLuceneManager();
        if (manager == null) {
            addWarning("Lucene fulltext index is disabled");
            return null;
        }
       
        WGResultSet resultSet;
        try {
            resultSet = manager.search(db, queryData.getQuery(), parameters, (HttpServletRequest) getPageContext().getRequest());
        }
        catch (WGQueryException e) {
            this.addWarning("Error executing query: " + e.getError() + "{Query: " + e.getQuery() + "}", true);
            status.error = e;
            resultSet = null;
View Full Code Here

Examples of de.innovationgate.wgpublisher.lucene.LuceneManager

      }
     
         WGFactory.getInstance().closeSessions();
        
         // close opened lucene-resultsets
         LuceneManager luceneManager = _core.getLuceneManager();
         if (luceneManager != null) {
             luceneManager.closeOpenedResultSets();
         }
        
         _currentRequests.remove(request);
       }
  }
View Full Code Here

Examples of de.spotnik.mail.core.internal.lucene.LuceneManager

   
    /* @see junit.framework.TestCase#tearDown() */
    @Override
    protected void tearDown() throws Exception
    {
        LuceneManager lm = (LuceneManager) CONTEXT.getBean("lucene.manager");
       
        lm.closeIndexWriter();
        super.tearDown();
    }
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

    public static void main(String[] args) throws IOException {
      String luceneIndexFileName = "data/apple-example/LuceneIndex-apple50_test";
      String resourcePriorsFileName = "data/apple-example/3apples-scores.tsv";

      // Lucene Manager - Controls indexing and searching
      LuceneManager luceneManager = new LuceneManager(FSDirectory.open(new File(luceneIndexFileName)));

        try {
            new CustomScoresDisambiguator(new LuceneCandidateSearcher(luceneManager, false), new DataLoader(new DataLoader.TSVParser(), new File("data/Distinct-surfaceForm-By-uri.grouped")));
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

    }

    public static void main(String[] args) throws IOException, SearchException, ItemNotFoundException {
        //String dir = "/home/pablo/workspace/spotlight/output/candidateIndexTitRedDis";
        String dir = "/home/pablo/workspace/spotlight/index/output/candidateIndexTitRedDis";
        LuceneManager luceneManager = new LuceneManager.CaseSensitiveSurfaceForms(FSDirectory.open(new File(dir)));
        CandidateSearcher searcher = new LuceneCandidateSearcher(luceneManager, true);
        System.out.println(searcher.getCandidates(new SurfaceForm("berlin")));
        System.out.println(searcher.getCandidates(new SurfaceForm("Berlin")));
        System.out.println(searcher.getCandidates(new SurfaceForm("sdaf")));
    }
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

        File testFile = new File("E:/dbpa/data/Person_newSurrogates/wikipediaTest."+(new Double(percentageSplit*100)).intValue()+"."+targetType+".amb.tsv");

        // using the next few lines, to create "confusable-with", split in training and testing
        File instancesFile = new File("data/dbpedia/instance_types_en.nt");
        File surrogateIndexDir = new File("data/SurrogateIndex.TitRedDisOcc.lowerCase");
        LuceneManager manager = new LuceneManager.CaseInsensitiveSurfaceForms(FSDirectory.open(surrogateIndexDir));
        LuceneCandidateSearcher surrogateSearcher = new LuceneCandidateSearcher(manager, false);
        Set<String> surfaceForms = getConfusableSurfaceForms(targetType, instancesFile, surrogateSearcher);

        DatasetSplitter splitter = new BySurfaceForm(trainingFile, testFile, minSize, percentageSplit, surfaceForms);
        //DatasetSplitter splitter = new BySize(trainingFile, testFile, minSize, percentageSplit);
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

        try { minCount = Integer.valueOf(args[2]); } catch(ArrayIndexOutOfBoundsException ignored) {}
        try { luceneManagerType = args[3]; } catch(ArrayIndexOutOfBoundsException ignored) {}
        try { shouldOverwrite = args[4].contains("overwrite"); } catch(Exception ignored) {}

        LuceneManager mLucene;
        if (luceneManagerType.contains("case-sensitive")) {
            mLucene = new LuceneManager.CaseSensitiveSurfaceForms(FSDirectory.open(new File(outputDirName)));
        } else if (luceneManagerType.contains("buffered")){
            mLucene = new LuceneManager.BufferedMerging(FSDirectory.open(new File(outputDirName)));
        } else if (luceneManagerType.contains("phonetic")){
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

    public static LuceneManager getSourceManager(String fileName, IndexingConfiguration config) throws IOException {
        File indexFile = new File(fileName);
        if (!indexFile.exists())
            throw new IOException("source index dir "+indexFile+" does not exist; ");
        LuceneManager lucene = new LuceneManager.BufferedMerging(LuceneManager.pickDirectory(indexFile));
        lucene.setDefaultAnalyzer(config.getAnalyzer());
        return lucene;
    }
View Full Code Here

Examples of org.dbpedia.spotlight.lucene.LuceneManager

    }
    public static LuceneManager getTargetManager(String fileName, IndexingConfiguration config) throws IOException {
        File indexFile = new File(fileName);
        if (indexFile.exists())
            throw new IOException("target index dir "+indexFile+" exists; I am afraid of overwriting. ");
        LuceneManager lucene = new LuceneManager.BufferedMerging(LuceneManager.pickDirectory(indexFile));
        lucene.setDefaultAnalyzer(config.getAnalyzer());
        return lucene;
    }
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.