コード例 #1
0
 def __init__(self, ctrl, graphics):
     TextModel.__init__(self, ctrl, graphics, [
         "Welcome to Berkeley!", "This is a unique adventure.",
         "You will experience every aspect of life at Cal, Bearlife.",
         "...", "......",
         "Oops! You found yourself locked in Soda Hall, ...",
         "... and you need to go to Hilfinger's Lecture.", "...",
         "... which is in DWINELLE...", "FOUND YOUR WAY OUT of Soda!"
     ], 'title')
コード例 #2
0
ファイル: StartModel.py プロジェクト: YAQIMIAO/bearlife
 def __init__(self, ctrl, graphics):
     TextModel.__init__(self, ctrl, graphics, ["Welcome to Berkeley!", "This is a unique adventure.",
             "You will experience every aspect of life at Cal, Bearlife.",
             "...",
             "......",
             "Oops! You found yourself locked in Soda Hall, ...",
             "... and you need to go to Hilfinger's Lecture.",
             "...",
             "... which is in DWINELLE...",
             "FOUND YOUR WAY OUT of Soda!"
             ], 'title')
コード例 #3
0
ファイル: Spellchecker.py プロジェクト: jedrekf/spell-checker
 def __init__(self,
              corpus_size=60000,
              max_dist=2,
              freq_weighting='natural',
              dist_weight=1):
     #freq_weighting possible values - 'natural', 'none', 'log'
     self.ft = TextModel()
     self.tokenizer = transformers.Tokenizer.Tokenizer().fit()
     self.error_detector = transformers.ErrorDetector.ErrorDetector(
         self.ft).fit()
     self.candidate_generator = transformers.TrieCandidateGenerator.\
         TrieCandidateGenerator(vocab_size=corpus_size, max_dist=max_dist, model=self.ft).fit()
     self.context_vectorizer = transformers.ContextVectorizer.ContextVectorizer(
         self.ft, freq_weighting).fit()
     self.candidate_vectorizer = transformers.CandidateVectorizer.CandidateVectorizer(
         self.ft).fit()
     self.similarity_calculator = transformers.SimilarityCalculator.SimilarityCalculator(
     ).fit()
     self.score_calculator = transformers.ScoreCalculator.\
         ScoreCalculator(distance_weight=dist_weight).fit()
コード例 #4
0
 def __init__(self, ctrl, graphics):
     TextModel.__init__(self, ctrl, graphics, [], "blue")
コード例 #5
0
 def __init__(self, ctrl, graphics):
     TextModel.__init__(self, ctrl, graphics, [], 'blue')
コード例 #6
0
 def __init__(self, ctrl, graphics):
     TextModel.__init__(self, ctrl, graphics, [], 'pink')