import os
import pandas as pd
import parser
def fit(rules, new):
    for rule in rules:
        x, y, dist = rule
        posx = -1
        posy = -1
        for i,t in enumerate(new):
            if t == raw[x]:
                posx = i
            if t == raw[y]:
                posy = i
        if x == y:
            if posx < dist:
                return False
        else:
            if dist == -1:
                dist = dist+1
            if posx == -1 or posy == -1 or posy-posx <= dist:
                return False
    return True

if __name__ == '__main__':
    test = pd.read_csv('stanfordSentimentTreebank', header=None,
                       sep='\t')

    parser.add_argument('--inputfile', type=str, default=None,
                        help='type of the input data')

    args = parser.parse_args()
    if args.inputfile is None:
        # raw = input()
        rules = input()
    else:
        with open(args.inputfile,"r") as f:
            # raw = f.readline()
            rules = f.readline()


