1 | divert(-1) |
---|
2 | #-------------------------------------------------------------------------- |
---|
3 | |
---|
4 | # Macros defined here may be used in pattern specifications |
---|
5 | # You can modify this file according to your needs. |
---|
6 | |
---|
7 | # ENDOFSEGMENT and MORFIELD are macros expanded to, respectively, |
---|
8 | # end of segment marker (dependes on the format: flattened or not) |
---|
9 | # and the name of the annotation field containing morphological |
---|
10 | # information (standard value is 'lem'). These values are controlled |
---|
11 | # by programs using this file to expand search patterns (ser, grp, ...). |
---|
12 | |
---|
13 | # seg(type,form,annotation) |
---|
14 | |
---|
15 | define(`seg',`(\s*((\d+\s+)(\d+\s+)?)?dnl |
---|
16 | ifelse($1, `',`(\S+)', `($1)')\s+dnl |
---|
17 | ifelse($2, `',`(\S+)', `($2)')dnl |
---|
18 | ifelse($3, `',`((\s+\S+)*)', `(\s+($3))')\s*ENDOFSEGMENT)') |
---|
19 | |
---|
20 | # form(f) - segment containing the form f |
---|
21 | |
---|
22 | define(`form', `seg(,$1)') |
---|
23 | |
---|
24 | # field(f) segment containing auxiliary field f |
---|
25 | |
---|
26 | define(`field', `seg(,,`(\S+\s+)*($1)(\s+\S+)*')') |
---|
27 | |
---|
28 | # word, space, punct, number segments (assuming W, S, P, N segment types) |
---|
29 | |
---|
30 | define(`space', `seg(`S',`$1')') |
---|
31 | define(`word', `seg(`W',`$1')') |
---|
32 | define(`punct', `seg(`P',`$1')') |
---|
33 | define(`number', `seg(`N',`$1')') |
---|
34 | |
---|
35 | # macros specific to PMDB format |
---|
36 | |
---|
37 | define(`lexeme', `field(`MORFIELD:(\S+;)?$1,\S+')') |
---|
38 | define(`cat', `field(`MORFIELD:\S+,$1([,;]\S+)?')') |
---|
39 | |
---|
40 | |
---|
41 | # Place here your macro definitions. |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | #-------------------------------------------------------------------------- |
---|
52 | divert(0) |
---|