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
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
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
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
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)])