// Path: apimodels/src/main/java/info/puzz/a10000sentences/apimodels/LanguageVO.java
// @Data
// @Accessors(chain = true)
// @ToString
// public class LanguageVO {
//     String abbrev;
//     String abbrev3;
//     String family;
//     String name;
//     String nativeName;
//     boolean rightToLeft;
// 
//     public String getAbbrev() {
//         return abbrev;
//     }
// 
//     public LanguageVO setAbbrev(String abbrev) {
//         this.abbrev = abbrev;
//         return this;
//     }
// 
//     public String getAbbrev3() {
//         return abbrev3;
//     }
// 
//     public LanguageVO setAbbrev3(String abbrev3) {
//         this.abbrev3 = abbrev3;
//         return this;
//     }
// 
//     public String getFamily() {
//         return family;
//     }
// 
//     public LanguageVO setFamily(String family) {
//         this.family = family;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public LanguageVO setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getNativeName() {
//         return nativeName;
//     }
// 
//     public LanguageVO setNativeName(String nativeName) {
//         this.nativeName = nativeName;
//         return this;
//     }
// 
//     public boolean isRightToLeft() {
//         return rightToLeft;
//     }
// 
//     public LanguageVO setRightToLeft(boolean rightToLeft) {
//         this.rightToLeft = rightToLeft;
//         return this;
//     }
// }
// 
// Path: apimodels/src/main/java/info/puzz/a10000sentences/apimodels/SentenceVO.java
// @Data
// @Accessors(chain = true)
// @ToString
// public class SentenceVO {
//     String sentenceId;
//     /**
//      * This field is not sent to the client, it is used only for ordering when exporting sentences.
//      * This field cannot be unique, because the same sentenceId can be part of multiple collections.
//      * @see #sentenceId
//      */
//     int targetSentenceId;
//     String knownSentence;
//     String targetSentence;
// 
//     /**
//      * Calculated based on sentence length and words frequency.
//      */
//     float complexity;
// 
//     public String getSentenceId() {
//         return sentenceId;
//     }
// 
//     public SentenceVO setSentenceId(String sentenceId) {
//         this.sentenceId = sentenceId;
//         return this;
//     }
// 
//     public int getTargetSentenceId() {
//         return targetSentenceId;
//     }
// 
//     public SentenceVO setTargetSentenceId(int targetSentenceId) {
//         this.targetSentenceId = targetSentenceId;
//         return this;
//     }
// 
//     public String getKnownSentence() {
//         return knownSentence;
//     }
// 
//     public SentenceVO setKnownSentence(String knownSentence) {
//         this.knownSentence = knownSentence;
//         return this;
//     }
// 
//     public String getTargetSentence() {
//         return targetSentence;
//     }
// 
//     public SentenceVO setTargetSentence(String targetSentence) {
//         this.targetSentence = targetSentence;
//         return this;
//     }
// 
//     public float getComplexity() {
//         return complexity;
//     }
// 
//     public SentenceVO setComplexity(float complexity) {
//         this.complexity = complexity;
//         return this;
//     }
// }


import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import info.puzz.a10000sentences.apimodels.LanguageVO;
import info.puzz.a10000sentences.apimodels.SentenceVO;
import lombok.Getter;
package info.puzz.a10000sentences.importer;



/**
 * Helper for counting words (frequencies) in a collection.
 */
public class WordCounter {

    @Getter
    AtomicInteger count = new AtomicInteger(0);

    final Map<String, AtomicInteger> wordCounter = new HashMap<>();

    public WordCounter() {
    }

// Path: apimodels/src/main/java/info/puzz/a10000sentences/apimodels/LanguageVO.java
// @Data
// @Accessors(chain = true)
// @ToString
// public class LanguageVO {
//     String abbrev;
//     String abbrev3;
//     String family;
//     String name;
//     String nativeName;
//     boolean rightToLeft;
// 
//     public String getAbbrev() {
//         return abbrev;
//     }
// 
//     public LanguageVO setAbbrev(String abbrev) {
//         this.abbrev = abbrev;
//         return this;
//     }
// 
//     public String getAbbrev3() {
//         return abbrev3;
//     }
// 
//     public LanguageVO setAbbrev3(String abbrev3) {
//         this.abbrev3 = abbrev3;
//         return this;
//     }
// 
//     public String getFamily() {
//         return family;
//     }
// 
//     public LanguageVO setFamily(String family) {
//         this.family = family;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public LanguageVO setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getNativeName() {
//         return nativeName;
//     }
// 
//     public LanguageVO setNativeName(String nativeName) {
//         this.nativeName = nativeName;
//         return this;
//     }
// 
//     public boolean isRightToLeft() {
//         return rightToLeft;
//     }
// 
//     public LanguageVO setRightToLeft(boolean rightToLeft) {
//         this.rightToLeft = rightToLeft;
//         return this;
//     }
// }
// 
// Path: apimodels/src/main/java/info/puzz/a10000sentences/apimodels/SentenceVO.java
// @Data
// @Accessors(chain = true)
// @ToString
// public class SentenceVO {
//     String sentenceId;
//     /**
//      * This field is not sent to the client, it is used only for ordering when exporting sentences.
//      * This field cannot be unique, because the same sentenceId can be part of multiple collections.
//      * @see #sentenceId
//      */
//     int targetSentenceId;
//     String knownSentence;
//     String targetSentence;
// 
//     /**
//      * Calculated based on sentence length and words frequency.
//      */
//     float complexity;
// 
//     public String getSentenceId() {
//         return sentenceId;
//     }
// 
//     public SentenceVO setSentenceId(String sentenceId) {
//         this.sentenceId = sentenceId;
//         return this;
//     }
// 
//     public int getTargetSentenceId() {
//         return targetSentenceId;
//     }
// 
//     public SentenceVO setTargetSentenceId(int targetSentenceId) {
//         this.targetSentenceId = targetSentenceId;
//         return this;
//     }
// 
//     public String getKnownSentence() {
//         return knownSentence;
//     }
// 
//     public SentenceVO setKnownSentence(String knownSentence) {
//         this.knownSentence = knownSentence;
//         return this;
//     }
// 
//     public String getTargetSentence() {
//         return targetSentence;
//     }
// 
//     public SentenceVO setTargetSentence(String targetSentence) {
//         this.targetSentence = targetSentence;
//         return this;
//     }
// 
//     public float getComplexity() {
//         return complexity;
//     }
// 
//     public SentenceVO setComplexity(float complexity) {
//         this.complexity = complexity;
//         return this;
//     }
// }


// Path: tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/WordCounter.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import info.puzz.a10000sentences.apimodels.LanguageVO;
import info.puzz.a10000sentences.apimodels.SentenceVO;
import lombok.Getter;

package info.puzz.a10000sentences.importer;



/**
 * Helper for counting words (frequencies) in a collection.
 */
public class WordCounter {

    @Getter
    AtomicInteger count = new AtomicInteger(0);

    final Map<String, AtomicInteger> wordCounter = new HashMap<>();

    public WordCounter() {
    }

    public void countWordsInSentence(SentenceVO sentence, LanguageVO knownLang, LanguageVO targetLang) {