diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..ffa68d0
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,4 @@
+# Changelog
+
+## [1.9-SNAPSHOT] - 2020-11-25
+- for `.*\\.(freq|tsv)(\\.gz)?` input files automatically cumulate frequencies
diff --git a/pom.xml b/pom.xml
index 517804f..e33b4b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,12 +6,11 @@
 
     <groupId>groupId</groupId>
     <artifactId>nGrammFoldCount</artifactId>
-    <version>1.8-SNAPSHOT</version>
+    <version>1.9-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.release>11</maven.compiler.release>
-        <jackson.version>[2.10.3,)</jackson.version>
     </properties>
 
     <build>
diff --git a/src/main/java/org/ids_mannheim/FoldedEntry.java b/src/main/java/org/ids_mannheim/FoldedEntry.java
index 5a43746..a29714b 100644
--- a/src/main/java/org/ids_mannheim/FoldedEntry.java
+++ b/src/main/java/org/ids_mannheim/FoldedEntry.java
@@ -36,6 +36,15 @@
         });
     }
 
+    public static void add(ConcurrentHashMap<String, AtomicInteger> map, String ngram, int add) {
+        map.compute(ngram, (key, value) -> {
+            if (value == null) {
+                value = new AtomicInteger();
+            }
+            value.addAndGet(add);
+            return value;
+        });
+    }
     public static void incr(ConcurrentHashMap<String, FoldedEntry> map, String ngram, int fold) {
         map.compute(ngram, (key, value) -> {
             if (value == null) {
diff --git a/src/main/java/org/ids_mannheim/Worker.java b/src/main/java/org/ids_mannheim/Worker.java
index 3e89faa..f342eef 100644
--- a/src/main/java/org/ids_mannheim/Worker.java
+++ b/src/main/java/org/ids_mannheim/Worker.java
@@ -49,6 +49,7 @@
         try {
             int index = queue.take();
             int retries = MAX_RETRIES;
+            int texts = 0;
             SlidingWindowQueue slidingWindowQueue = new SlidingWindowQueue(ngram_size, s -> FoldedEntry.incr(map, s));
             while (index >= 0) {
                 String fname = fnames.get(index);
@@ -56,6 +57,7 @@
                 long file_size = current_file.length();
                 int poolIndex = 0;
                 BufferedReader in = null;
+                logger.info(String.format("Processing %d/%d %s %s", index, fnames.size(), pool.getHost(poolIndex), current_file.getName()));
                 if (fname.matches(".*\\.conllu\\.gz$")) {
                     in = new BufferedReader(new InputStreamReader(new ParallelGZIPInputStream(new FileInputStream(fname))));
                 } else if (fname.matches(".*\\.conllu?$")) {
@@ -69,14 +71,28 @@
                     };
                     Process p = Runtime.getRuntime().exec(cmd);
                     in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+                } else if (fname.matches(".*\\.(freq|tsv)(\\.gz)?$")) {
+                    in = new BufferedReader(new InputStreamReader(
+                            (fname.matches("\\.gz$") ?
+                                    new ParallelGZIPInputStream(new FileInputStream(fname)) :
+                                    new FileInputStream(fname))));
+                    String line;
+                    while((line = in.readLine()) != null) {
+                        int tabPos = line.lastIndexOf('\t');
+                        if (tabPos >= 0) {
+                            FoldedEntry.add(map, line.substring(0, tabPos), Integer.parseInt(line.substring(tabPos+1)));
+                        } else {
+                            logger.severe(new IllegalArgumentException("Cannot interpret tsv line: "+line).toString());
+                            System.exit(-1);
+                        }
+                    }
+                    texts++;
                 } else {
                     logger.severe(new IllegalArgumentException("Cannot guess file type for "+fname).toString());
                     System.exit(-1);
                 }
-                logger.info(String.format("Processing %d/%d %s %s", index, fnames.size(), pool.getHost(poolIndex), current_file.getName()));
                 String line;
                 int fold = -1;
-                int texts = 0;
                 while ((line = in.readLine()) != null) {
                     if (line.startsWith("#")) {
                         Matcher matcher = new_text_pattern.matcher(line);
