예제 #1
0
파일: test_ae.py 프로젝트: xgeric/redshift
def test_gold_right_oracle(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    state.transition('L-SUBJ')
    state.transition('S')
    state.transition('S')
    state.transition('L-OTHER')
    assert not state.is_gold('R-OTHER')
    assert not state.is_gold('S')
    assert not state.is_gold('D')
    assert not state.is_gold('L-OTHER')
    assert state.is_gold('R-OBJ')
예제 #2
0
def test_gold_right_oracle(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    state.transition('L-SUBJ')
    state.transition('S')
    state.transition('S')
    state.transition('L-OTHER')
    assert not state.is_gold('R-OTHER')
    assert not state.is_gold('S')
    assert not state.is_gold('D')
    assert not state.is_gold('L-OTHER')
    assert state.is_gold('R-OBJ')
예제 #3
0
파일: test_ae.py 프로젝트: xgeric/redshift
def test_sunk_right(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    assert state.top == 1
    assert not state.is_gold('R-OBJ')
    assert state.top == 1
    state.transition('R-OBJ')
    assert state.top == 2
    assert not state.is_gold('D')
    state.transition('D')
    assert not state.is_gold('R-OBJ')
    state.transition('R-OBJ')
    assert state.is_gold('D')
    assert not state.is_gold('L-OTHER')
    assert not state.is_valid('L-OTHER')
예제 #4
0
def test_sunk_right(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    assert state.top == 1
    assert not state.is_gold('R-OBJ')
    assert state.top == 1
    state.transition('R-OBJ')
    assert state.top == 2
    assert not state.is_gold('D')
    state.transition('D')
    assert not state.is_gold('R-OBJ')
    state.transition('R-OBJ')
    assert state.is_gold('D')
    assert not state.is_gold('L-OTHER')
    assert not state.is_valid('L-OTHER')
예제 #5
0
파일: test_ae.py 프로젝트: xgeric/redshift
def test_sunk_left(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    state.transition('L-SUBJ')
    state.transition('S')
    state.transition('S')
    assert not state.is_gold('S')
    state.transition('S')
    # Now have (is, a, test) on stack --- this is wrong
    assert state.is_gold('L-SUBJ')
    assert state.is_gold('L-ROOT')
    assert state.is_gold('L-OTHER')
    assert not state.is_gold('R-OTHER')
    assert not state.is_gold('R-OBJ')
    assert not state.is_gold('D')
    assert not state.is_gold('S')
    state.transition('L-SUBJ')
    assert state.is_gold('L-SUBJ')
    assert state.is_gold('L-ROOT')
    assert state.is_gold('L-OTHER')
    state.transition('L-ROOT')
    assert state.top == 2
    assert state.is_gold('R-OTHER')
예제 #6
0
def test_sunk_left(string, gold):
    state = PyState(string, gold=gold)
    state.transition('S')
    state.transition('L-SUBJ')
    state.transition('S')
    state.transition('S')
    assert not state.is_gold('S')
    state.transition('S')
    # Now have (is, a, test) on stack --- this is wrong
    assert state.is_gold('L-SUBJ')
    assert state.is_gold('L-ROOT')
    assert state.is_gold('L-OTHER')
    assert not state.is_gold('R-OTHER')
    assert not state.is_gold('R-OBJ')
    assert not state.is_gold('D')
    assert not state.is_gold('S')
    state.transition('L-SUBJ')
    assert state.is_gold('L-SUBJ')
    assert state.is_gold('L-ROOT')
    assert state.is_gold('L-OTHER')
    state.transition('L-ROOT')
    assert state.top == 2
    assert state.is_gold('R-OTHER')
예제 #7
0
파일: test_ae.py 프로젝트: xgeric/redshift
def test_init_oracle(string, gold):
    state = PyState(string, gold=gold)
    assert state.is_gold('S')
    assert not state.is_gold('D')
    assert not state.is_gold('R-OBJ')
    assert not state.is_gold('L-SUBJ')
예제 #8
0
def test_init_oracle(string, gold):
    state = PyState(string, gold=gold)
    assert state.is_gold('S')
    assert not state.is_gold('D')
    assert not state.is_gold('R-OBJ')
    assert not state.is_gold('L-SUBJ')