Package org.languagetool.tagging.de

Examples of org.languagetool.tagging.de.AnalyzedGermanToken


  }

  private boolean isNonPredicativeAdjective(AnalyzedGermanTokenReadings tokensReadings) {
    for (AnalyzedToken reading : tokensReadings.getReadings()) {
      if (reading instanceof AnalyzedGermanToken) {
        final AnalyzedGermanToken germanReading = (AnalyzedGermanToken) reading;
        if (germanReading.getType() == POSType.ADJEKTIV && !germanReading.getPOSTag().contains("PRD")) {
          return true;
        }
      }
    }
    return false;
View Full Code Here


            // tagging in Morphy for cities is not coherent:
            (nextATR.hasReadingOfType(POSType.PROPER_NOUN) || nextATR.hasReadingOfType(POSType.NOMEN) &&
            nextNextATR != null && nextNextATR.hasReadingOfType(POSType.NOMEN)))) {
          final AnalyzedGermanToken[] adjReadings = new AnalyzedGermanToken[ADJ_READINGS.length];
          for (int j = 0; j < ADJ_READINGS.length; j++) {
            adjReadings[j] = new AnalyzedGermanToken(nextTerm, ADJ_READINGS[j], null);
          }
          nextToken = new AnalyzedGermanTokenReadings(adjReadings, nextToken.getStartPos());
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
View Full Code Here

      if (token.getPOSTag() != null) {
        if (token.getPOSTag().equals(JLanguageTool.SENTENCE_END_TAGNAME) || token.getPOSTag().equals(JLanguageTool.PARAGRAPH_END_TAGNAME)) {
          return false;
        }
      }
      final AnalyzedGermanToken germanToken = new AnalyzedGermanToken(token);
      if (germanToken.getType() == type) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    return toRuleMatchArray(ruleMatches);
  }

  private boolean isNonPredicativeAdjective(AnalyzedTokenReadings tokensReadings) {
    for (AnalyzedToken reading : tokensReadings.getReadings()) {
      AnalyzedGermanToken germanReading = new AnalyzedGermanToken(reading);
      if (germanReading.getType() == POSType.ADJEKTIV && !germanReading.getPOSTag().contains("PRD")) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    return false;
  }

  private boolean isParticiple(AnalyzedTokenReadings tokensReadings) {
    for (AnalyzedToken reading : tokensReadings.getReadings()) {
      AnalyzedGermanToken germanReading = new AnalyzedGermanToken(reading);
      if (germanReading.getType() == POSType.PARTIZIP) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    for (AnalyzedToken tmpReading : readings) {
      if (skipSol && tmpReading.getPOSTag() != null && tmpReading.getPOSTag().endsWith(":SOL")) {
        // SOL = alleinstehend - needs to be skipped so we find errors like "An der roter Ampel."
        continue;
      }
      final AnalyzedGermanToken reading = new AnalyzedGermanToken(tmpReading);
      if (reading.getCasus() == null && reading.getNumerus() == null &&
          reading.getGenus() == null) {
        continue;
      }
      if (reading.getGenus() == GermanToken.Genus.ALLGEMEIN &&
              reading.getPOSTag() != null && !reading.getPOSTag().endsWith(":STV")) {  // STV: stellvertretend (!= begleitend)
        // genus=ALG in the original data. Not sure if this is allowed, but expand this so
        // e.g. "Ich Arbeiter" doesn't get flagged as incorrect:
        set.add(makeString(reading.getCasus(), reading.getNumerus(), GermanToken.Genus.MASKULINUM, omit));
        set.add(makeString(reading.getCasus(), reading.getNumerus(), GermanToken.Genus.FEMININUM, omit));
        set.add(makeString(reading.getCasus(), reading.getNumerus(), GermanToken.Genus.NEUTRUM, omit));
      } else {
        set.add(makeString(reading.getCasus(), reading.getNumerus(), reading.getGenus(), omit));
      }
    }
    return set;
  }
View Full Code Here

TOP

Related Classes of org.languagetool.tagging.de.AnalyzedGermanToken

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.