import re
import nltk
from features.nltk_tagger import count_tags
from features.FeatureFunction import FeatureFunction


class NounPercentage(FeatureFunction):

    def __init__(self):
        nltk.download('averaged_perceptron_tagger')
        super().__init__()

    def evaluate(self, context: str) ->float:
        return count_tags(context, ['NN', 'NNS', 'NNP', 'NNPS']) / len(context
            .split())

5b8fce364819863786cfa73f5a3f31c56bcc1892
<mask token>


class NounPercentage(FeatureFunction):
    <mask token>
    <mask token>

<mask token>


class NounPercentage(FeatureFunction):
    <mask token>

    def evaluate(self, context: str) ->float:
        return count_tags(context, ['NN', 'NNS', 'NNP', 'NNPS']) / len(context
            .split())

<mask token>


class NounPercentage(FeatureFunction):

    def __init__(self):
        nltk.download('averaged_perceptron_tagger')
        super().__init__()

    def evaluate(self, context: str) ->float:
        return count_tags(context, ['NN', 'NNS', 'NNP', 'NNPS']) / len(context
            .split())

import re
import nltk
from features.nltk_tagger import count_tags
from features.FeatureFunction import FeatureFunction


class NounPercentage(FeatureFunction):

    def __init__(self):
        nltk.download('averaged_perceptron_tagger')
        super().__init__()

    def evaluate(self, context: str) ->float:
        return count_tags(context, ['NN', 'NNS', 'NNP', 'NNPS']) / len(context
            .split())
