/** * Generates a set of IndexedWordProxy objects. If the current() field is present, splits the tokens by * a space, and for each, creates a new IndexedWordProxy, in order encountered, referencing this current * node, but using the lexical value of the current split token. Otherwise just use the value of word(). * This is used to retain attribution to the originating node. */ public static List<IndexedWordProxy> create(IndexedWord node) { List<IndexedWordProxy> ret = new ArrayList<>(); if (node.originalText().length() > 0) { for (String token : node.originalText().split(" ")) { ret.add(new IndexedWordProxy(node, token)); } } else { ret.add(new IndexedWordProxy(node, node.word())); } return ret; } }
/** * Generates a set of IndexedWordProxy objects. If the current() field is present, splits the tokens by * a space, and for each, creates a new IndexedWordProxy, in order encountered, referencing this current * node, but using the lexical value of the current split token. Otherwise just use the value of word(). * This is used to retain attribution to the originating node. */ public static List<IndexedWordProxy> create(IndexedWord node) { List<IndexedWordProxy> ret = new ArrayList<>(); if (node.originalText().length() > 0) { for (String token : node.originalText().split(" ")) { ret.add(new IndexedWordProxy(node, token)); } } else { ret.add(new IndexedWordProxy(node, node.word())); } return ret; } }
/** * Generates a set of IndexedWordProxy objects. If the current() field is present, splits the tokens by * a space, and for each, creates a new IndexedWordProxy, in order encountered, referencing this current * node, but using the lexical value of the current split token. Otherwise just use the value of word(). * This is used to retain attribution to the originating node. */ public static List<IndexedWordProxy> create(IndexedWord node) { List<IndexedWordProxy> ret = new ArrayList<>(); if (node.originalText().length() > 0) { for (String token : node.originalText().split(" ")) { ret.add(new IndexedWordProxy(node, token)); } } else { ret.add(new IndexedWordProxy(node, node.word())); } return ret; } }