':key: å©çšarticleçåè¡šåå§åè¯­æéãæ¯äžç¯articleçæ ŒåŒäžº: id[tab]word1 word2 word3......'

def init_corpus_with_articles(self, article_list):

    self.local_bi.clear()
    self.words_count = 0
    self.V = 0
    self.artids_list.clear()
    self.arts_Z.clear()
    self.M = 0
    self.local_2_global.clear()
    for line in article_list:
        frags = line.strip().split()
        if (len(frags) < 2):
            continue
        art_id = frags[0].strip()
        art_wordid_list = []
        for word in [w.strip() for w in frags[1:] if w.strip()]:
            local_id = (self.local_bi.get_key(word) if self.local_bi.contains_value(word) else len(self.local_bi))
            if (self.global_bi is None):
                self.local_bi.add_key_value(local_id, word)
                art_wordid_list.append(local_id)
            elif self.global_bi.contains_value(word):
                self.local_bi.add_key_value(local_id, word)
                art_wordid_list.append(local_id)
                self.local_2_global[local_id] = self.global_bi.get_key(word)
        if (len(art_wordid_list) > 0):
            self.words_count += len(art_wordid_list)
            self.artids_list.append(art_id)
            self.arts_Z.append(art_wordid_list)
    self.V = len(self.local_bi)
    logging.debug(((('words    number:    ' + str(self.V)) + ',    ') + str(self.words_count)))
    self.M = len(self.artids_list)
    logging.debug(('articles    number:    ' + str(self.M)))
    return
