procgen  Diff

Differences From Artifact [98598e4655]:

To Artifact [fa196ac94e]:


     1         -; ʞ / verb.scm
     2         -;	(depends lisp-macro.scm struct.scm)
     3         -;	a library by lexi hale
     4         -;
     5         -; macros, functions, and rules for conjugating verbs and 
     6         -; generating verb phrases. this library rules was written 
     7         -; specifically for english verbs and cannot be used as a
     8         -; "drop-in" library for other languages; however, the
     9         -; structured and functions used are sufficiently generic
    10         -; that it should be portable to other languages with
            1  +; [ʞ] verb.scm
            2  +;  ~ lexi hale <lexi@hale.su>
            3  +;  © affero general public license
            4  +;  > (load "lib/lisp-macro.scm")
            5  +;    (load "lib/struct.scm")
            6  +;    (load "lib/verb.scm")
            7  +
            8  +; macros, functions, and rules  for conjugating verbs and
            9  +; generating verb phrases. this library rules was written
           10  +; specifically for english verbs and  cannot be used as a
           11  +; "drop-in"  library for  other  languages; however,  the
           12  +; structured and functions  used are sufficiently generic
           13  +; that  it should  be  portable to  other languages  with
    11     14   ; minimal effort.
    12     15   
    13     16   ;;;; section i. generic functions & structures
    14     17   
    15     18   ; struct verb
    16     19   ;  fields contain conjugation functions for the specified
    17     20   ;  tense. ((v 'inf) object) will generate a verb phrase string
................................................................................
    21     24   ;   'ger: gerund (-ing form)
    22     25   ;   'pst: past (-ed form)
    23     26   ;   'ppl: past participle (often -ed or -en)
    24     27   ; * l10n note: the fields mentioned in the last line of the
    25     28   ;   (verb-form) macro must always match the fields listed in
    26     29   (define verb (struct 'inf 'prs 'ger 'adj 'pst 'ppl))
    27     30   
    28         -; takes a list of individual strings and joins them with
           31  +; takes a list of individual  strings and joins them with
    29     32   ; spaces. occurrences of "a" are automatically replace by
    30     33   ; "an" if the word following them appears to start with a
    31         -; vowel. this can be forcibly induced by preceeding that
           34  +; vowel. this can be  forcibly induced by preceeding that
    32     35   ; word with the symbol 'vowel in the list
    33     36   ; TODO: make it handle initialisms. yes, everything about
    34     37   ; this is horrible. yes, this *is* the wrong way to do it.
    35     38   ; yes, i *am* ashamed. why do you ask
    36     39   (define (word-append . body)
    37     40     (define (vowel? c) (member c '("a" "e" "i" "o" "u")))
    38     41     (define (vowel-onset? w)
................................................................................
    83     86   
    84     87   ; create a compound form a verb that already exists
    85     88   ; - prefix: prefix to append (e.g. up, out, over, un)
    86     89   ; - vb: final, "stem" verb
    87     90   (define (compound prefix vb) (lambda (form) (lambda (*o*)
    88     91   	  (word-append (string-append prefix ((vb form) *o*))))))
    89     92   
    90         -; create a verb where another string interposes between the
    91         -; root verb and the object. this can be used to implement
    92         -; object incorporation or prepositional verbs such as "get
    93         -; off on" (not to be confused with phrasal verbs)
    94         -; a phrasal verb.
           93  +; create a  verb where another string  interposes between
           94  +; the  root verb  and the  object.  this can  be used  to
           95  +; implement object  incorporation or  prepositional verbs
           96  +; such as "get  off on" (not to be  confused with phrasal
           97  +; verbs) a phrasal verb.
    95     98   ; - vb: the root (leftmost) verb
    96         -; - pps: the preposition complex immediately following the
    97         -;   verb.
           99  +; - pps: the preposition complex immediately following
          100  +;   the verb.
    98    101   (define (postpositive vb post) (lambda (form) (lambda (*o*)
    99    102   	(if (or (equal? form 'ppl) (equal? form 'adj))
   100    103   		(word-append
   101    104   		  (string-append ((vb form) '()) "-" post)
   102    105   		  *o*)
   103    106   		(word-append ((vb form) '()) post *o*)))))
   104    107