private Datum extractFeatures(LocalTrigramContext local) {
        Datum d = new Datum();
        d.addFV("p2", local.getPreviousPreviousWord() + ":" + local.getPreviousPreviousTag());
        d.addFV("pt2", local.getPreviousPreviousTag());
        d.addFV("p1", local.getPreviousWord() + ":" + local.getPreviousTag());
        d.addFV("pt1", local.getPreviousTag());
        d.addFV("cw", local.getCurrentWord());
        d.addFV("wf", wordFeature(local.getCurrentWord()));
        if (local.getPosition() > 0) {
            d.addFV("pwf", wordFeature(local.getPreviousWord()));
        }
        if (local.getPosition() > 1) {
            d.addFV("pwf2", wordFeature(local.getPreviousWord()));
        }
        for (int pre = 0; pre < 4; pre++) {
            String prefix = getPrefix(local.getCurrentWord(), pre);
            if (prefix != null) {
                d.addFV("prefix" + String.valueOf(pre), prefix);
            }
        }
        for (int suf = 0; suf < 4; suf++) {
            String suffix = getSuffix(local.getCurrentWord(), suf);
            if (suffix != null) {
                d.addFV("suffix" + String.valueOf(suf), suffix);
            }
        }
        return d;
    }