Пример #1
0
 def parse_to_entitylist(cls, text):
     entitylist = EntityList(None)
     text = cls.patterns['comment'].sub('', text)
     matchlist = cls.patterns['entity'].findall(text)
     for match in matchlist:
         entitylist.add(Entity(match[0], match[1]))
     return entitylist
Пример #2
0
 def parse_to_entitylist(cls, text):
     entitylist = EntityList(id=None)
     text = cls.patterns['comment'].sub('', text)
     matchlist = cls.patterns['entity'].findall(text)
     for match in matchlist:
         entitylist.add(Entity(match[0], match[1]))
     return entitylist
Пример #3
0
 def entitylist(self):
     """
     returns an ElementList representation of the L10nObject
     """
     entityList = EntityList()
     entityList.id = self.id
     entityList.fallback = self.fallback
     for entity in self.entities().values():
         entityList.add(entity)
     return entityList
Пример #4
0
 def parse_to_entitylist(cls, text):
     elist = EntityList(id=None)
     text = cls.patterns["comment"].sub("", text)
     for match in cls.patterns["entity"].findall(text):
         elist.add(Entity(match[0], match[1][1:-1]))
     return elist
Пример #5
0
 def entitylist(self):
     """Returns an EntityList object with entities from the Structure.
     """
     return EntityList(self.id,
                       *[item for item in self if is_entity(item)])