Esempio n. 1
1
 private StringBuilder prefix() {
   StringBuilder sb = new StringBuilder("(");
   sb.append(pos.shortForm);
   if (spos != null && spos != SecondaryPos.None) sb.append(",").append(spos.shortForm);
   if (suffixList.size() > 0) sb.append(";");
   return sb;
 }
Esempio n. 2
1
 public String formatNoEmpty() {
   StringBuilder sb = new StringBuilder("[(").append(dictionaryItem.lemma).append(") ");
   for (InflectionalGroup ig : inflectionalGroups) {
     sb.append(ig.formatNoEmpty());
   }
   sb.append("]");
   return sb.toString();
 }
Esempio n. 3
1
 public String formatNoSurface() {
   StringBuilder sb = prefix();
   int j = 0;
   for (SuffixData suffixData : suffixList) {
     sb.append(suffixData.suffix.id);
     if (j < suffixList.size() - 1) sb.append("+");
     j++;
   }
   sb.append(")");
   return sb.toString();
 }
Esempio n. 4
1
  public String formatOflazer() {
    StringBuilder sb = new StringBuilder();
    sb.append(dictionaryItem.root).append("+");

    int i = 0;
    for (InflectionalGroup ig : inflectionalGroups) {
      if (i == 0) {
        if (ig.pos == PrimaryPos.Adverb) {
          sb.append("Adverb"); // Oflazer uses Adverb, we use Adv
        } else sb.append(ig.pos.shortForm);
        if (ig.spos != null && ig.spos != SecondaryPos.None)
          sb.append("+").append(ig.spos.shortForm);
        if (!ig.suffixList.isEmpty()) sb.append("+");
      } else {
        if (sb.charAt(sb.length() - 1) == '+') {
          sb.deleteCharAt(sb.length() - 1); // delete +
        }
        sb.append("^DB+").append(ig.pos.shortForm).append("+");
      }
      int j = 0;
      for (SuffixData sd : ig.suffixList) {
        String suffixId = sd.suffix.id;
        if (oflazerTable.containsKey(suffixId)) suffixId = oflazerTable.get(suffixId);
        sb.append(suffixId);
        if (j < ig.suffixList.size() - 1) sb.append("+");
        j++;
      }
      i++;
    }
    return sb.toString();
  }
Esempio n. 5
1
 public String formatNoEmpty() {
   StringBuilder sb = prefix();
   int j = 0;
   for (SuffixData suffixData : suffixList) {
     if (suffixData.surface.length() == 0) {
       continue;
     }
     if (j > 0 && j < suffixList.size() - 1) sb.append("+");
     sb.append(suffixData.suffix.id);
     j++;
   }
   if (sb.charAt(sb.length() - 1) == ';') sb.deleteCharAt(sb.length() - 1);
   sb.append(")");
   return sb.toString();
 }
Esempio n. 6
1
 public String surfaceForm() {
   StringBuilder sb = new StringBuilder();
   for (SuffixData suffixData : suffixList) {
     sb.append(suffixData.surface);
   }
   return sb.toString();
 }
Esempio n. 7
0
 public String formatOnlyIgs() {
   StringBuilder sb = new StringBuilder();
   for (InflectionalGroup ig : inflectionalGroups) {
     sb.append(ig.formatNoSurface());
   }
   return sb.toString();
 }
Esempio n. 8
0
 /**
  * Splits the parse into stem and ending. Such as: "kitaplar" -> "kitap-lar" "kitabımdaki" ->
  * "kitab-ımdaki" "kitap" -> "kitap-"
  *
  * @return a StemAndEnding instance carrying stem and ending. If ending has no surface content
  *     empty string is used.
  */
 public StemAndEnding getStemAndEndıng() {
   StringBuilder sb = new StringBuilder();
   for (InflectionalGroup ig : inflectionalGroups) {
     for (SuffixData data : ig.suffixList) {
       sb.append(data.surface);
     }
   }
   return new StemAndEnding(root, sb.toString());
 }
Esempio n. 9
0
 public String formatLong() {
   StringBuilder sb = prefix();
   sb.append(Joiner.on("+").join(suffixList));
   sb.append(")");
   return sb.toString();
 }