/** * Parses and create a gazetteer node from a string * * @param node the gazetteer node to be parsed * @param separator the separator used in the gazetteer node string to delimit * each name-value pair of features. If the separator is null, then the whole * node will be used as the gazetteer entry * @param isOrdered true if the feature maps used should be ordered */ public GazetteerNode(String node, String separator, boolean isOrdered) { this.separator = (separator != null && separator.length() == 0)? null : separator; int index_sep; if(this.separator == null || (index_sep = node.indexOf(this.separator)) == -1 ) { entry = node; // leave featureMap null } else { entry = node.substring(0, index_sep); String features = node.substring(index_sep + 1); featureMap = getFeatures(features, isOrdered); } }