예제 #1
0
파일: AnBn.py 프로젝트: wrongu/LOTlib
    def __init__(self, A='a', B='b', max_length=10):
        assert len(A) == 1 and len(B) == 1, 'atom length should be one'

        self.A = A
        self.B = B

        FormalLanguage.__init__(self, max_length)
예제 #2
0
파일: Dyck.py 프로젝트: ebigelow/LOTlib
    def __init__(self, A='(', B=')'):
        assert len(A) == 1 and len(B) == 1, 'len(A) should be 1 and len(B) should be 1'

        FormalLanguage.__init__(self)

        self.A = A
        self.B = B
예제 #3
0
파일: Dyck.py 프로젝트: wrongu/LOTlib
    def __init__(self, A='a', B='b', max_length=8):
        assert len(A) == 1 and len(B) == 1, 'atom length should be one'

        self.A = A
        self.B = B

        FormalLanguage.__init__(self, max_length)
예제 #4
0
파일: AnB2n.py 프로젝트: wrongu/LOTlib
    def __init__(self, A='a', B='bb', max_length=12):
        assert len(A) == 1 and len(B) == 2, 'len(A) should be 1 and len(B) should be 2'

        self.A = A
        self.B = B

        FormalLanguage.__init__(self, max_length)
예제 #5
0
    def __init__(self, max_length=5):
        """
        NOTE: we specify the size of pool from which we will draw our X in sampling strings instead of max_length
        """

        self.A = ['a', 'c', 'e']
        self.B = ['b', 'd', 'f']
        self.C = ['h', 'i', 'j', 'k']

        FormalLanguage.__init__(self, max_length)
예제 #6
0
파일: AnB2n.py 프로젝트: ebigelow/LOTlib
    def __init__(self, A='a', B='bb'):
        """
        don't use char like | and ) currently
        """
        assert len(A) == 1 and len(B) == 2, 'len(A) should be 1 and len(B) should be 2'

        FormalLanguage.__init__(self)

        self.A = A
        self.B = B
예제 #7
0
    def __init__(self, max_length=5):
        """
        NOTE: we specify the size of pool from which we will draw our X in sampling strings instead of max_length
        """

        self.A = ['a', 'c', 'e']
        self.B = ['b', 'd', 'f']
        self.C = ['h', 'i', 'j', 'k']

        FormalLanguage.__init__(self, max_length)
예제 #8
0
파일: AnBn.py 프로젝트: ebigelow/LOTlib
    def __init__(self, A='a', B='b'):
        """
        don't use char like | and ) currently
        """
        assert len(A) == 1 and len(B) == 1, 'max_length should be divisible by len(A)+len(B)'

        FormalLanguage.__init__(self)

        self.A = A
        self.B = B
예제 #9
0
파일: AnBnCn.py 프로젝트: ebigelow/LOTlib
    def __init__(self, A='a', B='b', C='c'):
        """
        don't use char like | and ) currently
        """
        assert len(A) == 1 and len(B) == 1 and len(C) == 1, 'len of A, B, C'

        FormalLanguage.__init__(self)

        self.A = A
        self.B = B
        self.C = C
예제 #10
0
    def __init__(self, max_length=6):
        self.grammar = Grammar(start='S')
        self.grammar.add_rule('S', 'S', ['NP', 'VP'], 1.0)
        self.grammar.add_rule('NP', 'NP', ['d', 'AP', 'n'], 1.0)
        self.grammar.add_rule('AP', 'AP', ['a', 'AP'], 1.0)
        self.grammar.add_rule('AP', 'AP', None, 1.0)

        self.grammar.add_rule('VP', 'VP', ['v'], 1.0)
        self.grammar.add_rule('VP', 'VP', ['v', 'NP'], 1.0)
        self.grammar.add_rule('VP', 'VP', ['v', 't', 'S'], 1.0)

        FormalLanguage.__init__(self, max_length)
예제 #11
0
    def __init__(self, max_length=6):
        self.grammar = Grammar(start='S')
        self.grammar.add_rule('S', 'S', ['NP', 'VP'], 1.0)
        self.grammar.add_rule('NP', 'NP', ['d', 'AP', 'n'], 1.0)
        self.grammar.add_rule('AP', 'AP', ['a', 'AP'], 1.0)
        self.grammar.add_rule('AP', 'AP', None, 1.0)

        self.grammar.add_rule('VP', 'VP', ['v'], 1.0)
        self.grammar.add_rule('VP', 'VP', ['v', 'NP'], 1.0)
        self.grammar.add_rule('VP', 'VP', ['v', 't', 'S'], 1.0)

        FormalLanguage.__init__(self, max_length)
예제 #12
0
 def __init__(self, atom='a', max_length=10):
     self.atom = atom
     FormalLanguage.__init__(self, max_length)
예제 #13
0
파일: An.py 프로젝트: ebigelow/LOTlib
 def __init__(self, atom='a'):
     """
     don't use char like | and ) currently
     """
     FormalLanguage.__init__(self)
     self.atom = atom