1 package org.catacomb.druid.xtext.parse; 2 3 4 import org.catacomb.druid.xtext.base.ContainerBlock; 5 import org.catacomb.report.E; 6 7 8 public class TextSplitter { 9 10 //String sourceText; 11 12 public TextSplitter(String txt) { 13 // sourceText = txt; 14 } 15 16 17 18 19 public ContainerBlock makeBlock() { 20 ContainerBlock bdoc = new ContainerBlock(); 21 // bdoc.setGuise(StandardGuises.getDocument()); 22 23 E.missing(); 24 25 /* 26 27 for (Paragraph par : Paragraphizer.paragraphize(sourceText)) { 28 ContainerBlock bp = new ContainerBlock(); 29 // bp.setGuise(StandardGuises.getParagraph()); 30 31 for (Sentence sen : Sentencizer.sentencize(par.getText())) { 32 ContainerBlock bs = new ContainerBlock(); 33 // bs.setGuise(StandardGuises.getSentence()); 34 35 for (Term w : Termizer.termize(sen.getText() + " ")) { 36 if (w.isWord()) { 37 WordBlock bw = new WordBlock(); 38 // bw.setGuise(StandardGuises.getWord()); 39 bw.setText(w.getText()); 40 bs.addBlock(bw); 41 } else { 42 PunctuationBlock bpunc = new PunctuationBlock(); 43 // bpunc.setGuise(StandardGuises.getWord()); 44 bpunc.setText(w.getText()); 45 bs.addBlock(bpunc); 46 } 47 } 48 49 50 bp.addBlock(bs); 51 } 52 bdoc.addBlock(bp); 53 bdoc.addBlock(new NewlineBlock()); 54 bdoc.addBlock(new NewlineBlock()); 55 } 56 57 bdoc.link(); 58 */ 59 60 return bdoc; 61 } 62 63 64 65 66 }