Examples of taggedTokenProvider()


Examples of org.dbpedia.spotlight.model.SpotlightFactory.taggedTokenProvider()

     * Advanced Spotter:
     */
    Spotter spotterWithSelector = SpotterWithSelector.getInstance(
        spotter,
        new CoOccurrenceBasedSelector(configuration.getSpotterConfiguration()),
        spotlightFactory.taggedTokenProvider()
    );

    extract(jsonObject, spotterWithSelector);

  }
View Full Code Here

Examples of org.dbpedia.spotlight.model.TaggedText.taggedTokenProvider()

  @Override
  /** {@inheritDoc} */
  public Instance buildInstance(SurfaceFormOccurrence surfaceFormOccurrence, Instance instance) {

    TaggedText text = (TaggedText) surfaceFormOccurrence.context();
    List<TaggedToken> candidateTokens = text.taggedTokenProvider().getTaggedTokens(surfaceFormOccurrence);
    int termSize = candidateTokens.size();

    TaggedToken firstTaggedToken = candidateTokens.get(0);
    CandidateData firstTaggedTokenData = null;
    try {
View Full Code Here

Examples of org.dbpedia.spotlight.model.TaggedText.taggedTokenProvider()

     * Left context
     */

    List<TaggedToken> leftContext = null;
    try {
      leftContext = text.taggedTokenProvider().getLeftContext(surfaceFormOccurrence, 2);
    } catch (ItemNotFoundException ignored) {}

    CandidateData left1 = null;
    if(leftContext != null && leftContext.size() > 0) {
      try {
View Full Code Here

Examples of org.dbpedia.spotlight.model.TaggedText.taggedTokenProvider()

     * Right context
     */

    List<TaggedToken> rightContext = null;
    try {
      rightContext = text.taggedTokenProvider().getRightContext(surfaceFormOccurrence, 2);
    } catch (ItemNotFoundException ignored) {}

    CandidateData right1 = null;
    if(rightContext != null && rightContext.size() > 0) {
      try {
View Full Code Here

Examples of org.dbpedia.spotlight.model.TaggedText.taggedTokenProvider()

    try{
      instance.setValue(i(candidate_size, buildAttributeList()), termSize);
    } catch (ArrayIndexOutOfBoundsException ignored) {}

    try {
      TaggedToken leftNeighbourToken = text.taggedTokenProvider().getLeftNeighbourToken(surfaceFormOccurrence);

      if(leftNeighbourToken.getPOSTag().equals("to")) {
        instance.setValue(i(pre_pos, buildAttributeList()), 0);
      }
      else if(leftNeighbourToken.getPOSTag().matches("[mnf].*")) {
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.