<gh_stars>10-100
from .base import BaseFeatureExtractor

SENTINAL_CHAR = " "  # non breaking space

class CharacterNgramFeatureExtractor(BaseFeatureExtractor):
    def __init__(self, n=2):
        self.n = n

    def features(self, string):
        return self._each_cons(SENTINAL_CHAR + string + SENTINAL_CHAR, self.n)

from .base import BaseFeatureExtractor

SENTINAL_CHAR = " "  # non breaking space

class CharacterNgramFeatureExtractor(BaseFeatureExtractor):
    def __init__(self, n=2):
        self.n = n

    def features(self, string):
        return self._each_cons(SENTINAL_CHAR + string + SENTINAL_CHAR, self.n)
# non breaking space