totalngrams: fix calculations with unsigned integers > 2^31
diff --git a/src/main/java/org/ids_mannheim/TotalNGram.java b/src/main/java/org/ids_mannheim/TotalNGram.java
index d09012b..2774da4 100644
--- a/src/main/java/org/ids_mannheim/TotalNGram.java
+++ b/src/main/java/org/ids_mannheim/TotalNGram.java
@@ -158,9 +158,9 @@
System.err.println("Calculating column sums.");
IntStream.rangeClosed(1, FOLDS)
.parallel()
- .forEachOrdered(i -> output_stream.print("\t" + map.values()
- .parallelStream().mapToLong(e -> Integer.toUnsignedLong(e.count.get(i))).sum()));
- output_stream.println("\t" + map.values().parallelStream().mapToLong(e -> Integer.toUnsignedLong(e.count.get(0))).sum());
+ .forEachOrdered(i -> output_stream.print("\t" + Long.toUnsignedString(map.values()
+ .parallelStream().mapToLong(e -> Integer.toUnsignedLong(e.count.get(i))).sum())));
+ output_stream.println("\t" + Long.toUnsignedString(map.values().parallelStream().mapToLong(e -> Integer.toUnsignedLong(e.count.get(0))).sum()));
output_stream.close();
return null;
}