    @Test
    public void count() {

        // build a dictionary of all words we see in a subset of the text
        Map<String, Integer> dict = VectorText.tokenize(sample.split("\\.")[0]).collect(
                TreeMap::new,
                (Map<String, Integer> d, String s) -> d.put(s, d.size()),
                Map::putAll
        );
        dict.remove("5");
        dict.put("tiger", dict.size());

        int[] v = VectorText.count(dict, sample);
        assertArrayEquals(new int[]{1, 1, 2, 0, 1, 1, 1}, v);
    }