From 2ae44902e1284270754d177530ea168cf9b11901 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Thu, 24 May 2018 13:47:11 +0000 Subject: [PATCH] (refman) update pre syntax [ci skip] --- doc/gf-refman.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/gf-refman.html b/doc/gf-refman.html index 1db2b0a87..19e943c49 100644 --- a/doc/gf-refman.html +++ b/doc/gf-refman.html @@ -1834,7 +1834,7 @@ Some expressions are moreover left- or right-associative. 5 -pre {"a" ; "an"/vowel} +pre {vowel => "an" ; _ => "a"} prefix-dependent choice @@ -2264,7 +2264,7 @@ Expressions of type Str have the following canonical forms:
  • the empty token list, []
  • concatenation, s ++ t, where s,t : Str
  • prefix-dependent choice, - pre { s ; s1 / p1 ; ... ; sn / pn}, where + pre {p1 => s1 ; ... ; pn => sn ; _ => s }, where
    • s, s1,...,sn, p1,...,pn : Str
    @@ -2344,13 +2344,16 @@ A prime example of prefix-dependent choice operation is the following approximative expression for the English indefinite article:

    -    pre {"a" ; "an" / variants {"a" ; "e" ; "i" ; "o"}}
    +  pre {
    +    ("a" | "e" | "i" | "o") => "an" ;
    +    _ => "a"
    +  } ;
     

    This expression can be computed in the context of a subsequent token:

      -
    • pre { s ; s1 / p1 ; ... ; sn / pn} ++ t +
    • pre {p1 => s1 ; ... ; pn => sn ; _ => s } ++ t ==>
      • si for the first i such that the prefix pi @@ -2374,6 +2377,11 @@ subsequent token depends on a run-time variable. The prefix-dependent choice expression itself may not depend on run-time variables.

        +

        + There is an older syntax for prefix-dependent choice, + namely: pre { s ; s1 / p1 ; ... ; sn / pn}. This syntax + will not accept strings as patterns. +

        In GF prior to 3.0, a specific type Strs is used for defining prefixes,