articles/models.py
def measure_ego(self):
        """
        Measure the number of first-person pronouns
        """
        text = self.extract_article()

        # For each keyword, search through and get the score
        keywords = ("I", "me", "my", "myself", "mine")
        scores = {}
        for keyword in keywords:
            tokens = re.findall(r"\b(%s)\b" % keyword.lower(), text, re.I)
            scores[keyword] = len(tokens)

        self.word_count = len(text.split(' '))
        self.scores = json.dumps(scores)
        self.score = round(1000 * float(self.get_total())/float(self.word_count), 2)

        Measure the number of first-person pronouns
        
Measure the number of first-person pronouns
Measure the number of first - person pronouns
def measure_ego(self):
        text = self.extract_article()
        keywords = ("I", "me", "my", "myself", "mine")
        scores = {}
        for keyword in keywords:
            tokens = re.findall(r"\b(%s)\b" % keyword.lower(), text, re.I)
            scores[keyword] = len(tokens)
        self.word_count = len(text.split(' '))
        self.scores = json.dumps(scores)
        self.score = round(1000 * float(self.get_total())/float(self.word_count), 2)
def measure_ego ( self ) : text = self . extract_article ( ) keywords = ( "I" , "me" , "my" , "myself" , "mine" ) scores = { } for keyword in keywords : tokens = re . findall ( r"\b(%s)\b" % keyword . lower ( ) , text , re . I ) scores [ keyword ] = len ( tokens ) self . word_count = len ( text . split ( ' ' ) ) self . scores = json . dumps ( scores ) self . score = round ( 1000 * float ( self . get_total ( ) ) / float ( self . word_count ) , 2 )
Measure the number of first-person pronouns
Measure the number of first - person pronouns
"""
        Measure the number of first-person pronouns
        """ # For each keyword, search through and get the score
self