Package org.dbpedia.spotlight.model

Examples of org.dbpedia.spotlight.model.SurfaceForm


            String resourceString = line[1];
            //TODO read counts and set DBpediaResource.support
            // int countSfRes = new Integer(line[2])
            DBpediaResource res = new DBpediaResource(resourceString);
            // DBpediaResource res = new DBpediaResource(resourceString,countSfRes)
            List<SurfaceForm> surfaceForms = AddSurfaceFormsToIndex.fromTitlesToAlternativesJ(new SurfaceForm(surfaceFormString));
            add(surfaceForms, res);
        }

        LOG.info("Done.");
    }
View Full Code Here


            String countAndSf = line[0];
            int count = Integer.valueOf(countAndSf.substring(0,7).trim());
            String resourceString = countAndSf.substring(8);
            String surfaceFormString = line[1];
            if (count>minCount)
                add(new SurfaceForm(surfaceFormString), new DBpediaResource(resourceString), count);
                List<SurfaceForm> surfaceForms = AddSurfaceFormsToIndex.fromTitlesToAlternativesJ(new SurfaceForm(surfaceFormString));
                add(surfaceForms, new DBpediaResource(resourceString));
            } catch(ArrayIndexOutOfBoundsException e) {
                LOG.error("Error parsing line: "+line);
                e.printStackTrace();
            }
View Full Code Here

     * @param r
     * @throws IndexException
     */
    public void add(DBpediaResourceOccurrence r) throws IndexException {
        //TODO FIXME quick hack to run overnight.
        addOccurrence(new DBpediaResourceOccurrence(r.resource(), new SurfaceForm(r.surfaceForm().name().toLowerCase()), r.context(), r.textOffset(), r.provenance()));
        //addOccurrence(r);
        numEntriesIndexed++;
    }
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.model.SurfaceForm

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.