コード例 #1
0
def test1():
    fst1 = TokenRegex("abc")
    fst2 = TokenRegex(["abc", "fff"])
    fst3 = TokenRegex(["a", "b", "c", "d"])

    grapth = FstGraph(fst3)
    grapth.draw("outfiles//test_tokenre_1")
コード例 #2
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test1():
    fst1 = TokenRegex("abc")
    fst2 = TokenRegex(["abc", "fff"])
    fst3 = TokenRegex(["a", "b", "c", "d"])

    grapth = FstGraph(fst3)
    grapth.draw("outfiles//test_tokenre_1")
コード例 #3
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test4():
    item1 =  ["a","b","c"] 
    item2 =   [item1,item1 ] 
    item3 =   Alternate([item1,item1]) 
    fst = FstMachine(item3)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test4")
コード例 #4
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test4():
    item1 = ["a", "b", "c"]
    item2 = [item1, item1]
    item3 = Alternate([item1, item1])
    fst = TokenRegex(item3)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test4")
コード例 #5
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test1():
    fst = FstMachine("abc")
    fst = FstMachine(["abc","fff"])
    fst = FstMachine(["a","b","c","d"])
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test1")
コード例 #6
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test2():
    item1 = Alternate(["a","b","c"])
    item2 =   ["d","e",item1,"f"] 
    item3 =   Alternate([item1,"d","e"])
    item4 =   ["z","y", item3]
    fst = FstMachine(item4)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test2")
コード例 #7
0
def test9():
    item1 = ["a", "b", "c"]
    item2 = [item1, item1]
    item3 = Alternate(["a", "a"])
    item4 = Alternate([item3, item3])
    fst = TokenRegex(item4)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test9")
コード例 #8
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test8():
    item1 =  ["a","b","c"] 
    item2 =   [item1,item1 ] 
    item3 =   Alternate(["a","a"]) 
    item4 =   Alternate([item3 , item3]) 
    fst = FstMachine(item4)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test8")
コード例 #9
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test9():
    item1 = ["a", "b", "c"]
    item2 = [item1, item1]
    item3 = Alternate(["a", "a"])
    item4 = Alternate([item3, item3])
    fst = TokenRegex(item4)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test9")
コード例 #10
0
def test7():
    item1 = [
        "DL",
        StarRepetition([",", "DL"]),
        QuestionRepetition(["or", "DL"]), "DEGREE"
    ]

    fst = TokenRegex(item1)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test6")
コード例 #11
0
def test2():
    item1 = Alternate(["a", "b", "c"])
    item2 = ["d", "e", item1, "f"]
    item3 = Alternate([item1, "d", "e"])
    item4 = ["z", "y", item3, "x", "o"]
    item5 = Alternate(["z", "y", "x", "o"])
    item6 = [item1, item5]
    fst = TokenRegex(item2)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test2")
コード例 #12
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test6():
    item1 = StarRepetition(["a", "b", "c"])
    item2 = StarRepetition("r")
    item3 = Alternate(["d", "e"])
    item4 = ["z", "y", item1, "x"]
    item5 = ["z", "y", item2, item3]
    item6 = QuestionRepetition(Alternate([item1, item2]))
    fst = TokenRegex(item5)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test6")
コード例 #13
0
def test5():
    item1 = PlusRepetition(["a", "b", "c"])
    item2 = PlusRepetition("r")
    item3 = Alternate(["d", "e"])
    item4 = ["z", "y", item3, item2]
    item5 = ["z", "y", item2, item3]
    item6 = QuestionRepetition(Alternate([item1, item2]))
    fst = TokenRegex(item1)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test5")
コード例 #14
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test6():
    item1 = StarRepetition(["a","b","c"])
    item2 =  StarRepetition("r")
    item3 =   Alternate(["d","e"])
    item4 =   ["z","y", item1]
    item5 =   ["z","y", item2,item3]
    item6 = QuestionRepetition(  Alternate([item1, item2])) 
    fst = FstMachine(item4)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test6")
コード例 #15
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test2():
    item1 = Alternate(["a", "b", "c"])
    item2 = ["d", "e", item1, "f"]
    item3 = Alternate([item1, "d", "e"])
    item4 = ["z", "y", item3, "x", "o"]
    item5 = Alternate(["z", "y", "x", "o"])
    item6 = [item1, item5]
    fst = TokenRegex(item2)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test2")
コード例 #16
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test5():
    item1 = PlusRepetition(["a","b","c"])
    item2 =  PlusRepetition("r")
    item3 =   Alternate(["d","e"])
    item4 =   ["z","y", item3, item2]
    item5 =   ["z","y", item2,item3]
    item6 = QuestionRepetition(  Alternate([item1, item2])) 
    fst = FstMachine(item2)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test5")
コード例 #17
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test8():
    item1 = Alternate(["a", "b"])
    item2 = QuestionRepetition(Alternate(["d", "e"]))
    item3 = StarRepetition(["f", "g"])
    item4 = PlusRepetition(["h", "i"])

    item8 = [item1, item2, item3, item4]

    fst = TokenRegex(item8)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test8")
コード例 #18
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test3():
    item1 = QuestionRepetition(["a", "b", "c"])
    item2 = QuestionRepetition("r")
    item3 = ["d", "e", item1, "f"]
    item4 = ["z", "y", item2]
    item5 = ["z", "y", item1, item2]
    item6 = QuestionRepetition(Alternate([item1, item2]))
    item7 = ["a", "b", Alternate(["c", "d", ""]), "e"]
    fst = TokenRegex(item7)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test3")
コード例 #19
0
def test3():
    item1 = QuestionRepetition(["a", "b", "c"])
    item2 = QuestionRepetition("r")
    item3 = ["d", "e", item1, "f"]
    item4 = ["z", "y", item2]
    item5 = ["z", "y", item1, item2]
    item6 = QuestionRepetition(Alternate([item1, item2]))
    item7 = ["a", "b", Alternate(["c", "d", ""]), "e"]
    fst = TokenRegex(item7)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test3")
コード例 #20
0
def test8():
    item1 = Alternate(["a", "b"])
    item2 = QuestionRepetition(Alternate(["d", "e"]))
    item3 = StarRepetition(["f", "g"])
    item4 = PlusRepetition(["h", "i"])

    item8 = [item1, item2, item3, item4]

    fst = TokenRegex(item8)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test8")
コード例 #21
0
ファイル: test_fst1.py プロジェクト: folagit/resumatcher
def test9():
    pattern1 = Alternate(["ccc","fff"])   
    pattern2 = [ "bbb", pattern1 ]
    pattern3 = [pattern2,"ggg"]
    
    pattern4 = ["bbb","ccc"]
    pattern5 = Alternate([pattern4,"bbb"]) 
    pattern6 = Alternate(["bbb",pattern4])
    pattern7 = Alternate([ ["bbb","ddd"],pattern4])
    pattern8 = ["aaa", Alternate([pattern3, pattern7 ]) ,"ddd" ]
    
    
    fst = FstMachine(pattern8)    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test9")
コード例 #22
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test1():
    tokens = ["aaa", "bbb", "ccc", "ddd"]

    pattern1 = "aaa"
    pattern2 = "bbb"
    pattern3 = ["bbb", "ccc"]
    pattern4 = "ddd"
    pattern5 = "eee"

    fst = TokenRegex(pattern4)
    track = fst._match(tokens)
    printTrack(track)

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_1")
コード例 #23
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test1():
    tokens = ["aaa","bbb","ccc","ddd"]    
    
    pattern1 = "aaa"
    pattern2 = "bbb"
    pattern3 = ["bbb","ccc"]
    pattern4 = "ddd"
    pattern5 = "eee"
    
    fst = TokenRegex(pattern4) 
    track =  fst._match(tokens) 
    printTrack(track)
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_1")
コード例 #24
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test7():
    pattern1 = ["DL", StarRepetition([",","DL"]), QuestionRepetition(["or","DL"]),"DEGREE" ]
    fst = TokenRegex(pattern1) 
    
    tokens = [ "aaa","bbb","aaa","bbb","ccc","ddd","eee"]
    tokens = [ "DL","DEGREE"]
    tokens = [ "DL","or", "DL", "DEGREE"]
    tokens = [ "DL","," , "DL", "or", "DL", "DEGREE"]
    tokens = [ "DL","," , "DL", "," , "DL", "or", "DL", "DEGREE"]
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_6")
    
    track =  fst._match(tokens) 
    print "==================================="
    printTrack(track)
コード例 #25
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test5():
    tokens = [ "aaa","bbb","aaa","bbb","ccc","ddd","eee"]    
    
    pattern1 = StarRepetition(["ccc","fff"])   
    pattern2 = StarRepetition(["aaa","bbb"])   
    pattern3 = ["bbb",pattern2]
    
    pattern4 = [pattern2,"ccc"]
    
    fst = TokenRegex(pattern4) 
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_5")
    
    track =  fst._match(tokens) 
    print "==================================="
    printTrack(track)
コード例 #26
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test6():
    tokens = [ "aaa","bbb" ]    
    
    pattern1 =  [ "aaa","bbb"]    
    pattern2 =  [ "aaa","bbb","ccc"]    
    pattern3 = Alternate([ pattern2 , [ "bbb"] ])
    
    pattern4 = [pattern1,"ccc"]
    
    fst = TokenRegex(pattern4) 
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_6")
    
    track =  fst._match(tokens) 
    print "==================================="
    printTrack(track)
コード例 #27
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test5():
    tokens = ["aaa", "bbb", "aaa", "bbb", "ccc", "ddd", "eee"]

    pattern1 = StarRepetition(["ccc", "fff"])
    pattern2 = StarRepetition(["aaa", "bbb"])
    pattern3 = ["bbb", pattern2]

    pattern4 = [pattern2, "ccc"]

    fst = TokenRegex(pattern4)

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_5")

    track = fst._match(tokens)
    print "==================================="
    printTrack(track)
コード例 #28
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test6():
    tokens = ["aaa", "bbb"]

    pattern1 = ["aaa", "bbb"]
    pattern2 = ["aaa", "bbb", "ccc"]
    pattern3 = Alternate([pattern2, ["bbb"]])

    pattern4 = [pattern1, "ccc"]

    fst = TokenRegex(pattern4)

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_6")

    track = fst._match(tokens)
    print "==================================="
    printTrack(track)
コード例 #29
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test7():
    pattern1 = [
        "DL",
        StarRepetition([",", "DL"]),
        QuestionRepetition(["or", "DL"]), "DEGREE"
    ]
    fst = TokenRegex(pattern1)

    tokens = ["aaa", "bbb", "aaa", "bbb", "ccc", "ddd", "eee"]
    tokens = ["DL", "DEGREE"]
    tokens = ["DL", "or", "DL", "DEGREE"]
    tokens = ["DL", ",", "DL", "or", "DL", "DEGREE"]
    tokens = ["DL", ",", "DL", ",", "DL", "or", "DL", "DEGREE"]

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_6")

    track = fst._match(tokens)
    print "==================================="
    printTrack(track)
コード例 #30
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test3():
    tokens = ["bbb","aaa","bbb","ccc","ddd","eee"]    
    
    pattern1 = QuestionRepetition(["bbb","ccc"])   
    pattern2 = [ "aaa", pattern1,"ddd" ]
    pattern3 = [ "aaa", pattern1,"ccc" ]
    pattern4 = [ "aaa", pattern1,"bbb" ]
   
    pattern5 = Alternate([pattern4,"bbb"]) 
    pattern6 = Alternate(["bbb",pattern4])
    pattern7 = Alternate([ ["bbb","ddd"],pattern4])
    pattern8 = [ QuestionRepetition(Alternate([pattern3, pattern4 ])) ,"ddd" ]
    
    fst = TokenRegex(pattern8) 
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_3")
    
    track =  fst._match(tokens) 
    print "==================================="
    printTrack(track)   
コード例 #31
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test2():
    tokens = ["000","aaa","bbb","aaa","bbb","ccc","ddd","eee"]    
    
    pattern1 = Alternate(["ccc","fff"])   
    pattern2 = [ "bbb", pattern1 ]
    pattern3 = [pattern2,"ggg"]
    
    pattern4 = ["bbb","ccc"]
    pattern5 = Alternate([pattern4,"bbb"]) 
    pattern6 = Alternate(["bbb",pattern4])
    pattern7 = Alternate([ ["bbb","ddd"],pattern4])
    pattern8 = ["aaa", Alternate([pattern3, pattern7 ]) ,"ddd" ]
    
    fst = TokenRegex(pattern8) 
    
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_2")
    
    track =  fst._match(tokens) 
    print "==================================="
    printTrack(track)
コード例 #32
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test2():
    tokens = ["000", "aaa", "bbb", "aaa", "bbb", "ccc", "ddd", "eee"]

    pattern1 = Alternate(["ccc", "fff"])
    pattern2 = ["bbb", pattern1]
    pattern3 = [pattern2, "ggg"]

    pattern4 = ["bbb", "ccc"]
    pattern5 = Alternate([pattern4, "bbb"])
    pattern6 = Alternate(["bbb", pattern4])
    pattern7 = Alternate([["bbb", "ddd"], pattern4])
    pattern8 = ["aaa", Alternate([pattern3, pattern7]), "ddd"]

    fst = TokenRegex(pattern8)

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_2")

    track = fst._match(tokens)
    print "==================================="
    printTrack(track)
コード例 #33
0
ファイル: test_tokenre2.py プロジェクト: folagit/resumatcher
def test3():
    tokens = ["bbb", "aaa", "bbb", "ccc", "ddd", "eee"]

    pattern1 = QuestionRepetition(["bbb", "ccc"])
    pattern2 = ["aaa", pattern1, "ddd"]
    pattern3 = ["aaa", pattern1, "ccc"]
    pattern4 = ["aaa", pattern1, "bbb"]

    pattern5 = Alternate([pattern4, "bbb"])
    pattern6 = Alternate(["bbb", pattern4])
    pattern7 = Alternate([["bbb", "ddd"], pattern4])
    pattern8 = [QuestionRepetition(Alternate([pattern3, pattern4])), "ddd"]

    fst = TokenRegex(pattern8)

    grapth = FstGraph(fst)
    grapth.draw("outfiles//test_tokenre2_3")

    track = fst._match(tokens)
    print "==================================="
    printTrack(track)
コード例 #34
0
ファイル: test_tokenre.py プロジェクト: pkushiqiang/jobaly
def test7():
    item1 = ["DL", StarRepetition([",", "DL"]), QuestionRepetition(["or", "DL"]), "DEGREE"]

    fst = TokenRegex(item1)
    grapth = FstGraph(fst)
    grapth.draw("outfiles//test6")