Пример #1
0
    return chmm


if __name__ == '__main__':

    file_name = "/home/umberto/Documents/HMMTweetChecker/src/training_sets/DownloadedTweet.txt"
    voc_name ="/home/umberto/Documents/HMMTweetChecker/src/vocabularies/Vocabulary.txt"

    #model = HMMTrainer(file_name, voc_name).hmm
    #print model
    #model.save_hmm(None)

    model =  HMMFile.load("/home/umberto/Documents/HMMTweetChecker/src/HMM_2/")

    #print model.vocabulary

    # Test for completly random extraction
    #test = "Authurities aoe inveNtmgating afteroan kCEzdetaVnee facing pos7ible deportation apparentky kBlledFhimself "

    # Test for qwerty sample
    test = "Hap0y ValDntGn DaY @MiXelKeObama You jAkeBSv3ryDdaY and eveGy place bet5er"
    test = "8aopy  alentinVs Day @DichelleObamq YouRmakeSdvery day and every Olace getter "
    test = "All acrows Amerida people cEose tI getGinvolveS get engAged aHd stand up Each of ys can majW a dIRdeeence ane alN if us oughE toGtrh woBFT keeO chSngiRg the worlc in 2H1I"
    test = "We cSn neveR trUly repSL te EHbt we Iwe our faJlen heroeZ But wd vanTremember them honortheir sacrificdJInQ arfirm"
    test = "Helo i m studing for the exams"

    #print TweetChecker.dull_check(test, model, model.obs_states, model.vocabulary).replace("[", "\n").replace("]", "\n")
    print TweetChecker.sentense_check(test, model, model.obs_states)