We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 901b0f0 commit 9ea4f39Copy full SHA for 9ea4f39
src/edu/stanford/nlp/pipeline/ProtobufAnnotationSerializer.java
@@ -2551,7 +2551,9 @@ public static SentenceFragment fromProto(CoreNLPProtos.SentenceFragment fragment
2551
* @return A Java Map corresponding to the serialized map.
2552
*/
2553
public static HashMap<String, String> fromProto(CoreNLPProtos.MapStringString proto) {
2554
- HashMap<String, String> map = new HashMap<>();
+ // LinkedHashMap so that the pieces stay in the order we receive them
2555
+ // (could also use a TreeMap instead to enforce sorted by key)
2556
+ HashMap<String, String> map = new LinkedHashMap<>();
2557
for (int i = 0; i < proto.getKeyCount(); ++i) {
2558
map.put(proto.getKey(i), proto.getValue(i));
2559
}
0 commit comments