示例#1
0
 def get_Corpus(self, name, corp_variant='', subcname=None):
     ans = EmptyCorpus()
     ans.corpname = name
     ans.subcname = subcname
     ans.size = 3000
     ans.search_size = lambda: 4000
     return ans
示例#2
0
 def get_info(self, corpus_id: str) -> DefaultManateeCorpusInfo:
     try:
         if corpus_id not in self._cache:
             self._cache[corpus_id] = DefaultManateeCorpusInfo(manatee.Corpus(corpus_id), corpus_id)
         return self._cache[corpus_id]
     except:
         # probably a misconfigured/missing corpus
         return DefaultManateeCorpusInfo(EmptyCorpus(corpname=corpus_id), corpus_id)
示例#3
0
 def get_info(self, canonical_corpus_id):
     try:
         if canonical_corpus_id not in self._cache:
             self._cache[canonical_corpus_id] = ManateeCorpusInfo(
                 manatee.Corpus(canonical_corpus_id), canonical_corpus_id)
         return self._cache[canonical_corpus_id]
     except:
         # probably a misconfigured/missing corpus
         return ManateeCorpusInfo(EmptyCorpus(corpname=canonical_corpus_id),
                                  canonical_corpus_id)
示例#4
0
 def get_Corpus(self, name, subcname=None):
     ans = EmptyCorpus()
     ans.corpname = name
     ans.subcname = subcname
     ans.size = 3000
     ans.search_size = lambda: 4000
     return ans
示例#5
0
 def corpus(self, cname: str) -> Corpus:
     if not cname:
         return EmptyCorpus()
     if cname not in self._corpora:
         self._corpora[cname] = self._cm.get_Corpus(cname)
     return self._corpora[cname]