Package org.apache.ctakes.coreference.eval.helpers

Examples of org.apache.ctakes.coreference.eval.helpers.Span


          goldSpan2id.put(p[0], ++id);
          String[] s = p[0].split("[-:]");
          int[] a = new int[s.length];
          for (int i = 0; i < s.length; i++)
            a[i] = Integer.parseInt(s[i]);
          goldSpans.add(new Span(a));
        }
        if (!goldSpan2id.containsKey(p[1])){
          goldSpan2id.put(p[1], ++id);
          String[] s = p[1].split("[-:]");
          int[] a = new int[s.length];
          for (int i = 0; i < s.length; i++)
            a[i] = Integer.parseInt(s[i]);
          goldSpans.add(new Span(a));         
        }
        goldPairs.add(new int[]{goldSpan2id.get(p[0]), goldSpan2id.get(p[1])});
        //      ppt_arr.add(new int[]{span2id.get(p[0]), span2id.get(p[1])});
      }
      br.close();
View Full Code Here


    for (int p = 1; p < lm.size(); ++p) {
      Markable m1 = (Markable) lm.get(p);
      int id1 = m1.getId();
      if (!sysSpan2id.containsKey(m1.getBegin()+"-"+m1.getEnd())) {
        sysSpan2id.put(m1.getBegin()+"-"+m1.getEnd(), id1);
        sysSpans.add(new Span(new int[]{m1.getBegin(), m1.getEnd()}));
      }
      for(int q = p-1; q >= 0; q--){
        Markable m2 = (Markable) lm.get(q);
        int id2 = m2.getId();
        if (!sysSpan2id.containsKey(m2.getBegin()+"-"+m2.getEnd())) {
          sysSpan2id.put(m2.getBegin()+"-"+m2.getEnd(), id2);
          sysSpans.add(new Span(new int[]{m2.getBegin(), m2.getEnd()}));
        }
        sysPairs.add(new int[]{id1, id2});

      }
    }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.coreference.eval.helpers.Span

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.