# Path: confopy/analysis/corpus.py
# class Corpus(Localizable, CorpusReader, Document):
#     """A corpus is a body of language data.
#     """
# 
#     def __init__(self, ID, language, brief=u"", description=u""):
#         """Initializer.
#         Args:
#             ID:          ID of the corpus (unicode string).
#             language:    Language code, e.g. u"de" or u"en".
#             brief:       Brief description of the corpus.
#             description: Long/full description of the corpus.
#         """
#         self.ID = ID
#         self.language = language
#         self.brief = brief
#         self.description = description
# 
#     def tagger(self):
#         """Returns the POS tagger.
#         """
#         return None
# 
#     def parser(self):
#         """Returns the syntax tree parser.
#         """
#         return None
# 
#     def sent_tokenizer(self):
#         """Returns the sentence tokenizer.
#         """
#         return None
# 
#     def fillers(self):
#         """Returns a list of fill words for the corpus language.
#         """
#         return list()


import os.path as op
import nltk
import confopy.config as C
                import sys
from cPickle import dump, load
from lxml import etree
from nltk.corpus.reader.api import CorpusReader
from nltk.corpus import BracketParseCorpusReader
from nltk.grammar import CFG, Nonterminal, induce_pcfg
from nltk.tokenize.punkt import PunktTrainer, PunktSentenceTokenizer
from confopy.analysis.corpus import Corpus
from fillers_de import FILLERS_DE
            children = list()
            for e in node.edges:
                children.append(self._conv_etree2tree(nodes.get(e[1]), nodes, e[0], include_edgelabels))
            return nltk.Tree(cat, children)
        return None

def _cached(obj, filepath, constructor):
    if obj is not None:
        return obj

    new_obj = None
    try:
        with open(filepath, 'rb') as f:
            new_obj = load(f)
    except IOError as e:
        #print u"Cache: couldn't read from %s" % filepath
        #print unicode(e)
        pass
    if new_obj is None:
        new_obj = constructor()
        try:
            with open(filepath, 'wb') as f:
                dump(new_obj, f, -1)
        except IOError as e:
            #print u"Cache: couldn't write to %s" % filepath
            #print unicode(e)
            pass
    return new_obj



# Path: confopy/analysis/corpus.py
# class Corpus(Localizable, CorpusReader, Document):
#     """A corpus is a body of language data.
#     """
# 
#     def __init__(self, ID, language, brief=u"", description=u""):
#         """Initializer.
#         Args:
#             ID:          ID of the corpus (unicode string).
#             language:    Language code, e.g. u"de" or u"en".
#             brief:       Brief description of the corpus.
#             description: Long/full description of the corpus.
#         """
#         self.ID = ID
#         self.language = language
#         self.brief = brief
#         self.description = description
# 
#     def tagger(self):
#         """Returns the POS tagger.
#         """
#         return None
# 
#     def parser(self):
#         """Returns the syntax tree parser.
#         """
#         return None
# 
#     def sent_tokenizer(self):
#         """Returns the sentence tokenizer.
#         """
#         return None
# 
#     def fillers(self):
#         """Returns a list of fill words for the corpus language.
#         """
#         return list()


# Path: confopy/localization/de/corpus_de/tiger.py
import os.path as op
import nltk
import confopy.config as C
                import sys
from cPickle import dump, load
from lxml import etree
from nltk.corpus.reader.api import CorpusReader
from nltk.corpus import BracketParseCorpusReader
from nltk.grammar import CFG, Nonterminal, induce_pcfg
from nltk.tokenize.punkt import PunktTrainer, PunktSentenceTokenizer
from confopy.analysis.corpus import Corpus
from fillers_de import FILLERS_DE

            children = list()
            for e in node.edges:
                children.append(self._conv_etree2tree(nodes.get(e[1]), nodes, e[0], include_edgelabels))
            return nltk.Tree(cat, children)
        return None

def _cached(obj, filepath, constructor):
    if obj is not None:
        return obj

    new_obj = None
    try:
        with open(filepath, 'rb') as f:
            new_obj = load(f)
    except IOError as e:
        #print u"Cache: couldn't read from %s" % filepath
        #print unicode(e)
        pass
    if new_obj is None:
        new_obj = constructor()
        try:
            with open(filepath, 'wb') as f:
                dump(new_obj, f, -1)
        except IOError as e:
            #print u"Cache: couldn't write to %s" % filepath
            #print unicode(e)
            pass
    return new_obj



class TigerCorpusReader(Corpus):