@Test public void canCreateSentences() throws UIMAException { JCas jCas = JCasFactory.createJCas(); SentenceFactory factory = new SentenceFactory(jCas); List<OdinSentence> sentences = factory.create(); assertNotNull(sentences); }
public List<OdinSentence> create() { List<Entry<Sentence, List<WordToken>>> entrySet = indexWords.entrySet().stream() .sorted(Comparator.comparing(e -> e.getKey().getBegin())) .collect(toList()); List<OdinSentence> sentences = new ArrayList<>(); for (Entry<Sentence, List<WordToken>> e : entrySet) { sentences.add(create(sentences.size(), e.getKey(), e.getValue())); } return sentences; }
SentenceFactory { public List<OdinSentence> create() { List<Entry<Sentence, List<WordToken>>> entrySet = indexWords.entrySet().stream() .sorted(Comparator.comparing(e -> e.getKey().getBegin())) .collect(toList()); List<OdinSentence> sentences = new ArrayList<>(); for (Entry<Sentence, List<WordToken>> e : entrySet) { sentences.add(create(sentences.size(), e.getKey(), e.getValue())); } return sentences; } }
SentenceFactory { public List<OdinSentence> create() { List<Entry<Sentence, List<WordToken>>> entrySet = indexWords.entrySet().stream() .sorted(Comparator.comparing(e -> e.getKey().getBegin())) .collect(toList()); List<OdinSentence> sentences = new ArrayList<>(); for (Entry<Sentence, List<WordToken>> e : entrySet) { sentences.add(create(sentences.size(), e.getKey(), e.getValue())); } return sentences; } SentenceFactory(JCas jCas); protected  SentenceFactory(
      Map<Sentence, List<WordToken>> indexWords,
      Map<WordToken, List<Entity>> indexEntities,
      Map<WordToken, List<PhraseChunk>> indexChunks,
      Map<Sentence, List<Dependency>> indexDependency); }
SentenceFactory { public List<OdinSentence> create() { List<Entry<Sentence, List<WordToken>>> entrySet = indexWords.entrySet().stream() .sorted(Comparator.comparing(e -> e.getKey().getBegin())) .collect(toList()); List<OdinSentence> sentences = new ArrayList<>(); for (Entry<Sentence, List<WordToken>> e : entrySet) { sentences.add(create(sentences.size(), e.getKey(), e.getValue())); } return sentences; } SentenceFactory(JCas jCas); protected  SentenceFactory(
      Map<Sentence, List<WordToken>> indexWords,
      Map<WordToken, List<Entity>> indexEntities,
      Map<WordToken, List<PhraseChunk>> indexChunks,
      Map<Sentence, List<Dependency>> indexDependency); List<OdinSentence> create(); }
SentenceFactory { public List<OdinSentence> create() { List<Entry<Sentence, List<WordToken>>> entrySet = indexWords.entrySet().stream() .sorted(Comparator.comparing(e -> e.getKey().getBegin())) .collect(toList()); List<OdinSentence> sentences = new ArrayList<>(); for (Entry<Sentence, List<WordToken>> e : entrySet) { sentences.add(create(sentences.size(), e.getKey(), e.getValue())); } return sentences; } SentenceFactory(JCas jCas); protected  SentenceFactory(
      Map<Sentence, List<WordToken>> indexWords,
      Map<WordToken, List<Entity>> indexEntities,
      Map<WordToken, List<PhraseChunk>> indexChunks,
      Map<Sentence, List<Dependency>> indexDependency); List<OdinSentence> create();  }