All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Python2.src.antlr4.tree.Chunk.py Maven / Gradle / Ivy

There is a newer version: 4.13.2
Show newest version
class Chunk(object):

    def __str__(self):
        return unicode(self)


class TagChunk(Chunk):

    def __init__(self, tag, label=None):
        self.tag = tag
        self.label = label

    def __unicode__(self):
        if self.label is None:
            return self.tag
        else:
            return self.label + ":" + self.tag

class TextChunk(Chunk):

    def __init__(self, text):
        self.text = text

    def __unicode__(self):
        return "'" + self.text + "'"





© 2015 - 2025 Weber Informatics LLC | Privacy Policy