Examples of MExpression


Examples of org.snu.ids.ha.ma.MExpression

    try {
      List<MExpression> meList = leaveJustBest(postProcess(analyze(string)));

      Morpheme mp = null;
      MCandidate mc = null;
      MExpression me = null;
      Keyword keyword = null;
      List<Morpheme> mpList = new ArrayList<Morpheme>();
      for( int i = 0, size = meList == null ? 0 : meList.size(); i < size; i++ ) {
        me = meList.get(i);
        mc = me.get(0);

        int jSize = mc.size();
        if( jSize == 1 ) {
          mp = mc.get(0);
          mp.setString(me.getExp());
          mpList.add(mp);
        } else {
          // 분할되지 않은 리스트 형태로 형태소를 넣어준다.
          for( int j = 0; j < jSize; j++ )
            mpList.add(mc.get(j));
View Full Code Here

Examples of org.snu.ids.ha.ma.MExpression

    // 점수 계산
    mc.getScore();
    // hashCode계산
    mc.calcHashCode();
   
    MExpression me = get(exp);

    if( me == null ) {
      me = new MExpression(exp, mc);
      float lnprOfSpacing = SpacingPDDictionary.getProb(exp);
      mc.setLnprOfSpacing(lnprOfSpacing);
      me.setLnprOfSpacing(lnprOfSpacing);
      table.put(exp, me);
      if( maxLen < exp.length() ) {
        maxLen = exp.length();
      }
    } else {
      mc.setLnprOfSpacing(me.getLnprOfSpacing());
      me.add(mc);
    }
  }
View Full Code Here

Examples of org.snu.ids.ha.ma.MExpression

   * @param exp
   * @return
   */
  synchronized public MExpression getMExpression(String exp)
  {
    MExpression ret = get(exp);
    return ret == null ? null : ret.copy();
  }
View Full Code Here

Examples of org.snu.ids.ha.ma.MExpression

    try {
      pw = new PrintWriter(new FileOutputStream(new File(fileName)));
      ArrayList<MExpression> list = new ArrayList<MExpression>(table.values());
      Collections.sort(list);
      for( int i = 0, stop = list.size(); i < stop; i++ ) {
        MExpression me = list.get(i);
        pw.println(me);
        pw.flush();
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.snu.ids.ha.ma.MExpression

    Timer timer = new Timer();
    timer.start();
    List<MCandidate> ret = new ArrayList<MCandidate>();
    getAsList();
    for( int i = 0; i < meList.size(); i++ ) {
      MExpression me = meList.get(i);
      if( me.getExp().indexOf(str) > -1 ) {
        ret.addAll(me);
      }
    }
    timer.printMsg(ret.size() + " candidates found.");
    timer.stop();
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.