File: approxtest.crm

package info (click to toggle)
crm114 20100106-9
  • links: PTS
  • area: main
  • in suites: buster
  • size: 3,184 kB
  • sloc: ansic: 34,910; sh: 617; makefile: 578; lisp: 208
file content (39 lines) | stat: -rwxr-xr-x 863 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/crm
#
#	approxtest.crm - test approximate regex matching,
#		usually reading from approxtest-args.txt

# Copyright 2009 William S. Yerazunis.
# This file is under GPLv3, as described in COPYING.

window
output / Start of approximate match testing. :*:_nl:/
isolate (:words:) /molasses anaconda foo bar baz agentsmith mranderson /
output /:*:_nl:Input string to match against: ":*:words:":*:_nl::*:_nl:/
isolate (:patterns:)
input (:patterns:)
isolate (:p:) /bleah/
{
	window <eofaccepts> (:p:) (:patterns:) /.*/ /:*:_nl:/
	match  (:z: :pa:) [:p:] /(.+)./
	output /:*:pa:/
	{
	    {
		{
			match (:out:) [:words:] /:*:pa:/
			output / ---> :*:out:/
		}
		alius
		{
			output / <no match> /
		}
     	    }
	    trap (:zeta:) /.*/
	    {
	    	output / <invalid> /
	    }
	}
	output /:*:_nl:/
	liaf
}
output / end of approximate match testing. :*:_nl:/