Пример #1
0
  public static boolean umpadi(Stack s) {
    byte[] topElmt = ((Entry) s.peek()).getPart();
    byte[] oldTopElmt = topElmt;

    if (ByteMeth.endsWith(topElmt, Constant.umpadi)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "umpadi");
      s.pop();
      s.push(new Entry(Constant.pati, Tag.ParticleSuffix));
      s.push(new Entry(Constant.um, Tag.ThirdFutureNeuterSingularORRP));
      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.umpadi.length);
      if (ByteMeth.isEqual(topElmt, Constant.kEtk)) {
        topElmt = ByteMeth.replace(topElmt, Constant.L, 2);
      }
      if (ByteMeth.endsWith(topElmt, Constant.var) || ByteMeth.endsWith(topElmt, Constant.thar)) {
        topElmt = ByteMeth.replace(topElmt, Constant.A, Constant.ar.length);
      }
      if (ByteMeth.isEqual(topElmt, Constant.kaRk)
          || ByteMeth.isEqual(topElmt, Constant.viRk)
          || ByteMeth.isEqual(topElmt, Constant.n_iRk)) {
        topElmt = ByteMeth.replace(topElmt, Constant.l, 2);
      }
      if (ByteMeth.isEqual(topElmt, Constant.sAk) || ByteMeth.isEqual(topElmt, Constant.pOk)) {
        topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - 1);
      }
      s.push(new Entry(topElmt, -1, oldTopElmt));
      Sandhi.kk(s);
      Sandhi.check(s);
      return true;
    }

    return false;
  }
Пример #2
0
  public static boolean imperativePlural1(Stack s) {
    // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "IPM1");
    byte[] topElmt = ((Entry) s.peek()).getPart();
    byte[] oldTopElmt = topElmt;

    // ungkaL
    if (ByteMeth.endsWith(topElmt, Constant.ungkaL)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "ungkaL");
      s.pop();
      s.push(new Entry(Constant.ungkaL, Tag.ImperativePluralSuffix));
      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.ungkaL.length);
      if (ByteMeth.isEqual(topElmt, Constant.vAr) || ByteMeth.isEqual(topElmt, Constant.thAr)) {
        topElmt = ByteMeth.replace(topElmt, Constant.aru, 2);
      }
      if (ByteMeth.isEqual(topElmt, Constant.sAk)) {
        topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - 1);
      }
      s.push(new Entry(topElmt, -1, oldTopElmt));
      Sandhi.type2(s);
      Sandhi.type5(s);
      return true;
    }
    return false;
  }
Пример #3
0
  public static boolean pronominal(Stack s) {
    // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "Verb Misc Pronominal");
    byte[] topElmt = ((Entry) s.peek()).getPart();
    byte[] oldTopElmt = topElmt;

    // van
    if (ByteMeth.endsWith(topElmt, Constant.van)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + an");
      s.pop();
      s.push(new Entry(Constant.an, Tag.PronominalThirdPersonMasculineSingular));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.van.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }
    // vaL
    if (ByteMeth.endsWith(topElmt, Constant.vaL)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + aL");
      s.pop();
      s.push(new Entry(Constant.aL, Tag.PronominalThirdPersonFemineSingular));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.vaL.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }
    // var
    if (ByteMeth.endsWith(topElmt, Constant.var)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + ar");
      s.pop();
      s.push(new Entry(Constant.ar, Tag.PronominalThirdPersonSingular));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.var.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }
    // varkaL
    if (ByteMeth.endsWith(topElmt, Constant.varkaL)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + arkaL");
      s.pop();
      s.push(new Entry(Constant.arkaL, Tag.PronominalThirdPersonPlural));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.varkaL.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }

    /* handled in Tense - athu
    //thu - not van-thu, seththu
    if(ByteMeth.endsWith(topElmt,Constant.thu) &&
    !ByteMeth.endsWith(topElmt,ByteMeth.addArray(Constant.n_,Constant.thu)) &&
    !ByteMeth.endsWith(topElmt,ByteMeth.addArray(Constant.th,Constant.thu)))
    {
    //clia.unl.unicode.utils.Utils.printOut(Analyser.print,x + "thu");
    s.pop();
    s.push(new Entry(Constant.thu,Tag.PronominalNeuterSingular));

    topElmt = ByteMeth.subArray(topElmt,0,topElmt.
    length-Constant.thu.length);
    s.push(new Entry(topElmt,-1,oldTopElmt));
    return true;
    }
    */
    // vai
    if (ByteMeth.endsWith(topElmt, Constant.vai)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + ai");
      s.pop();
      s.push(new Entry(Constant.ai, Tag.PronomianlNeuterPlural));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.vai.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }
    // enRu 23-04-07
    if (ByteMeth.endsWith(topElmt, Constant.enRu) && !(ByteMeth.isEqual(topElmt, Constant.cenRu))) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "enRu");
      s.pop();
      s.push(new Entry(Constant.enRu, Tag.ConjunctionSuffix));
      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.enRu.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }
    // vaikaL
    if (ByteMeth.endsWith(topElmt, Constant.vaikaL)) {
      // clia.unl.unicode.utils.Utils.printOut(Analyser.print, x + "v + aikaL");
      s.pop();
      s.push(new Entry(Constant.aikaL, Tag.PronomianlNeuterPlural));
      s.push(new Entry(Constant.v, Tag.Sandhi));

      topElmt = ByteMeth.subArray(topElmt, 0, topElmt.length - Constant.vaikaL.length);
      s.push(new Entry(topElmt, -1, oldTopElmt));
      return true;
    }

    return false;
  }