# -*- cg-pre-pipe: "apertium -d . dan-morph| cg-conv -*-
# GPL-2

SOFT-DELIMITERS = "<,>" cm ;
DELIMITERS = "<.>" "<:>" "<!>" "<?>" "<|>" "<$.>" "<$:>" "<$!>" "<$?>" "<$|>" sent ;

LIST <<< = <<< ;
LIST >>> = >>> ;

LIST sent = sent ;
LIST storbokstav = "<\\p{Lu}.*>"r ;
LIST ord = ord ;
LIST clb = clb ;

LIST sg = sg ;
LIST def = def ;
LIST cmp = cmp ;
LIST det-kvant = (det qnt) ;

TEMPLATE prevWordCrossSent = (-1 (*)) OR (-1 (>>>) LINK *-2< (<<<) BARRIER (<<<)) ;
TEMPLATE nextWordCrossSent = (1 (*))  OR (0  (<<<) LINK *1>  (>>>) BARRIER (>>>) LINK 1 (*)) ;

BEFORE-SECTIONS


SELECT:EOF sent IF
        (0 ord)
        (T:nextWordCrossSent LINK 0 <<<)
        ;

SELECT:klokka-14. sent IF
        (-1 ("klokke") + sg + def)
        (0 ord)
        ;

SELECT:1.000-kroneseddel cmp IF # This cohort is "<1.>" and the next one is "<000-kroneseddel>"
        (0 ord)
        (0 ("[0-9]+[.]"r))
        (T:nextWordCrossSent LINK 0 ("<[0-9]+-.*>"r))
        ;

REMOVE:1945.-. cmp IF
        (0 sent OR ord)
        (0 ("[0-9]+[.]"r))
        (NEGATE T:nextWordCrossSent LINK 0 ("<[0-9]+-.*>"r))
        ;

SELECT:hans-14.bursdag ord IF
        (0 sent)
        (NEGATE T:nextWordCrossSent LINK 0 storbokstav)
        ;

SELECT:blir-14.-Det sent IF
        (0 ord)
        (T:nextWordCrossSent LINK 0 storbokstav)
        ;

SELECT:over_30._Men clb IF
        (0/1 det-kvant)
        (0 <<<)
        (T:nextWordCrossSent LINK 0 storbokstav)
;

