Package org.dbpedia.spotlight.exceptions

Examples of org.dbpedia.spotlight.exceptions.SearchException


        //LOG.debug("Searching the index for text: "+text);
        List<FeatureVector> results = new LinkedList<FeatureVector>();
        try {
            results = search(mLucene.getQuery(text));
        } catch (Exception e) {
            throw new SearchException("Error searching for text "+text, e);
        }
        return results;
    }
View Full Code Here


        //LOG.debug("Searching the index for resource: "+resource);
        List<FeatureVector> results = new LinkedList<FeatureVector>();
        try {
            results = search(mLucene.getQuery(resource));
        } catch (Exception e) {
            throw new SearchException("Error searching for resource "+resource, e);
        }
        return results;
    }
View Full Code Here

        //LOG.debug("Searching the index for resource: "+resource);
        List<FeatureVector> results = new LinkedList<FeatureVector>();
        try {
            results = search(mLucene.getQuery(resource, context));
        } catch (Exception e) {
            throw new SearchException("Error searching for resource "+resource, e);
        }
        return results;
    }
View Full Code Here

        try {
            for (ScoreDoc hit: getHits(mLucene.getQuery(resource))) {
                if (!isDeleted(hit.doc)) results.add(getFullDocument(hit.doc));
            }
        } catch (Exception e) {
            throw new SearchException("Error searching for resource "+resource, e);
        }
        return results;
    }
View Full Code Here

        return 1;
    }

    @Override
    public List<Explanation> explain(DBpediaResourceOccurrence goldStandardOccurrence, int nExplanations) throws SearchException {
        throw new SearchException("Not implemented yet.");
    }
View Full Code Here

    public Document getFullDocument(int docNo) throws SearchException {
        Document document;
        try {
            document = mReader.document(docNo);
        } catch (IOException e) {
            throw new SearchException("Error reading document "+docNo,e);
        }
        return document;
    }
View Full Code Here

        Document document;
        try {
            document = mReader.document(docNo, selector);
            //document = mReader.document(docNo, fieldSelector);
        } catch (IOException e) {
            throw new SearchException("Error reading document "+docNo,e);
        }
        //LOG.debug("docNo:"+docNo);
        return document;
    }
View Full Code Here

            long end = System.nanoTime();
            LOG.debug(String.format("Done search in %f ms. hits.length=%d",(end-start) / 1000000.0, hits.length));
        } catch (TimeLimitingCollector.TimeExceededException timedOutException) {
            throw new TimeoutException("Timeout (>"+timeout+"ms searching for surface form "+query.toString(),timedOutException);
        } catch (Exception e) {
            throw new SearchException("Error searching for surface form "+query.toString(),e);
        }
        //LOG.debug(hits.length+" hits found.");
        return hits;
    }
View Full Code Here

     */
    public ScoreDoc[] getHits(Text context, Set<DBpediaResource> resources) throws SearchException {
        try {
            return getHits(mLucene.getQuery(context, resources, this.mReader));
        } catch (IOException e) {
            throw new SearchException("Error while executing query. ",e);
        }
    }
View Full Code Here

        try {
            vector = mReader.getTermFreqVector(docNo, LuceneManager.DBpediaResourceField.CONTEXT.toString());
            if (vector==null)
                throw new IllegalStateException("TermFreqVector for document "+docNo+" is null.");
        } catch (IOException e) {
            throw new SearchException("Error reading TermFreqVector for surrogate "+docNo,e);
        }
        //LOG.debug("vector:"+vector);
        return vector;
    }
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.exceptions.SearchException

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.