comparison curlers.py @ 19:f8d0a5201dd7

Remove deadwood.
author David Barts <n5jrn@me.com>
date Sat, 28 Dec 2019 00:46:38 -0800
parents b2dab0667ec2
children d3eb798f7e95
comparison
equal deleted inserted replaced
18:b2dab0667ec2 19:f8d0a5201dd7
69 self._pos = 0 69 self._pos = 0
70 self._state = self._norm 70 self._state = self._norm
71 for self._pos in range(len(self.workspace)): 71 for self._pos in range(len(self.workspace)):
72 self._state() 72 self._state()
73 73
74 def _is_cockney(self):
75 pos = self._pos
76 ws = self.workspace
77 for i in _ASTART:
78 li = len(i)
79 print("comparing {0!r} and {1!r}\n".format(ws[pos:pos+li].lower(), i))
80 if ws[pos:pos+li].lower() == i and not ws[pos+li].isalpha():
81 return True
82
83 def _norm(self): 74 def _norm(self):
84 pos = self._pos 75 pos = self._pos
85 ws = self.workspace 76 ws = self.workspace
86 char = ws[pos] 77 char = ws[pos]
87 if char == "\"": 78 if char == "\"":
145 def feed(self): 136 def feed(self):
146 self._pos = 0 137 self._pos = 0
147 self._state = self._norm 138 self._state = self._norm
148 for self._pos in range(len(self.workspace)): 139 for self._pos in range(len(self.workspace)):
149 self._state() 140 self._state()
150
151 def _is_cockney(self):
152 pos = self._pos
153 ws = self.workspace
154 for i in _ASTART:
155 li = len(i)
156 print("comparing {0!r} and {1!r}\n".format(ws[pos:pos+li].lower(), i))
157 if ws[pos:pos+li].lower() == i and not ws[pos+li].isalpha():
158 return True
159 141
160 def _goto_lt(self): 142 def _goto_lt(self):
161 self._ltpos = self._pos 143 self._ltpos = self._pos
162 self._ltstate = self._state 144 self._ltstate = self._state
163 self._state = self._seen_lt 145 self._state = self._seen_lt