try { while(null != (line = listReader.readLine())) { tempEntries.add(new GazetteerNode(line, separator));
node = new GazetteerNode(line, separator, isOrdered); } catch(Exception ex) { throw new GateRuntimeException("Could not read gazetteer entry "
theLanguage)); theList.add(new GazetteerNode(text)); gazetteer.add(theString, new Lookup(listName, annotType, "inferred", theLanguage)); theList.add(new GazetteerNode(theString));
LinearDefinition ld = gazetter.getLinearDefinition(); //add .lst record LinearNode ln = new LinearNode("glossary.lst", "minor", "major", "en", "AnnotType"); ld.add(ln); //add Lookup record Map<String, Object> features = new HashMap<>(); features.put("someFeatureName", "some value"); GazetteerNode gn = new GazetteerNode("string to be found", features); gn.setSeparator("@"); GazetteerList theList = ld.getListsByNode().get(ln); theList.add(gn); //save updated files theList.store(); ld.store(); //optionally re-init the gazetteer to make changes to work gazetter.reInit();
@Override public void actionPerformed(ActionEvent e) { GazetteerNode newGazetteerNode = new GazetteerNode(listEntryTextField.getText());