示例#1
0
 def process(self, mtree, options=None):
     GuessFinder(self.guess_properties, 1.0, self.log, options).process_nodes(mtree.unidentified_leaves())
     proper_count = 0
     for other_leaf in mtree.leaves_containing('other'):
         if 'other' in other_leaf.info and 'Proper' in other_leaf.info['other']:
             proper_count += 1
     if proper_count:
         found_property(mtree, 'properCount', proper_count)
示例#2
0
    def process(self, mtree, options=None):
        GuessFinder(self.guess_year, 1.0, self.log,
                    options).process_nodes(mtree.unidentified_leaves())

        # if we found a season number that is a valid year, it is usually safe to assume
        # we can also set the year property to that value
        for n in mtree.leaves_containing('season'):
            g = n.guess
            season = g['season']
            if valid_year(season):
                g['year'] = season
示例#3
0
 def process(self, mtree, options=None):
     GuessFinder(self.guess_country, None, self.log, options).process_nodes(mtree.unidentified_leaves())
     for node in mtree.leaves_containing('language'):
         c = node.clean_value.lower()
         if c in self.replace_language:
             node.guess.set('language', None)
             try:
                 country = Country.fromguessit(c)
                 if self.is_valid_country(country, options):
                     guess = Guess(country=country, confidence=0.9, input=node.value, span=node.span)
                     found_guess(node, guess, logger=log)
             except babelfish.Error:
                 pass
 def process(self, mtree, options=None):
     GuessFinder(self.expected_titles, None, self.log,
                 options).process_nodes(mtree.unidentified_leaves())
 def process(self, mtree, options=None):
     GuessFinder(self.guess_language, None, self.log,
                 options).process_nodes(mtree.unidentified_leaves())
 def process(self, mtree, options=None):
     GuessFinder(self.guess_year, 1.0, self.log, options).process_nodes(mtree.unidentified_leaves())
 def process(self, mtree, options=None):
     GuessFinder(self.guess_release_group, None, self.log,
                 options).process_nodes(mtree.unidentified_leaves())
 def process(self, mtree, options=None):
     GuessFinder(self.guess_weak_episodes_rexps, 0.6, self.log, options).process_nodes(mtree.unidentified_leaves())
 def process(self, mtree, options=None):
     GuessFinder(self.guess_idnumber, 0.4, self.log,
                 options).process_nodes(mtree.unidentified_leaves())