Changeset 95
- Timestamp:
- 07/17/06 16:12:39 (2 years ago)
- Files:
-
- freeform/trunk/freeform/match.py (modified) (1 diff)
- freeform/trunk/freeform_tests/profile_match.py (modified) (1 diff)
- freeform/trunk/freeform_tests/test_match.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freeform/trunk/freeform/match.py
r48 r95 229 229 #_debug_current_production(match, candidateforms, formfieldtypes, 230 230 # ifield-1,ifield,iword,ipluralstart,fieldcount-1) 231 # if the last field was a plural, make sure we collect all the trailing 232 # words. 233 if ipluralstart > -1: 234 match[-1].extend(words[iword:]) 231 235 return match, candidateforms 232 236 freeform/trunk/freeform_tests/profile_match.py
r50 r95 8 8 9 9 try: 10 import hotshot, hotshot.stats10 #import hotshot, hotshot.stats 11 11 PROFILE=1 12 12 except ImportError: freeform/trunk/freeform_tests/test_match.py
r48 r95 199 199 200 200 class TestDisambiguation(unittest.TestCase): 201 def test_plurals_as_last_candidatefield(self): 202 compiler = self.compiler 203 commandforms,e = compiler(['''\ 204 easy_track: 205 easytrac {label} {location} from {track(s)};''']) 206 formtable = formtable_prepare(create_formtable(*commandforms)) 207 result = match_command(formtable, 208 'easytrac barnwel-1 barnwell from tG,tS:0,60 0,60 25,40'.split()) 209 self.assertNotEqual(result, None) 210 self.assertNotEqual(result[0], None) 211 (cmd,form),valuemap=result 212 self.assertEqual(cmd, 'easy_track') 213 self.assertEqual(valuemap.has_key('track'), True) 214 self.assertEqual(len(valuemap['track'][0]), 3) 215 201 216 def _generic_source_tests(self, name, compiler = None): 202 217 compiler = compiler or self.compiler