% % stack: cust-text % % analyze customer text message % first adjust common usage of name and email indicators % "," " " replall ":" " " replall Str.NormSpc trim onlylf " email " lf &"email " replall " name " lf &"name " replall catlf &"|" catlf 0 -1 1 splitsln % % stack: [ [|]token . . . ] count % empty !Cust.First empty !Cust.Middle empty !Cust.Last empty !Cust.Pronoun empty !Cust.Gender empty !Cust.Email empty !Cust.Addr empty !Cust.Guid dup "@" found? { % % this is an email % trim dup !Cust.Email !Cust.Xemail } { % % this is a name % trim " " slice trim any? { % % has first and last at least % " " slice trim any? { % % has third name, this is last % !Cust.Last ^" " & dup !Cust.First !Cust.Xfirst } { % % has only two names, first and last % !Cust.Last dup !Cust.First !Cust.Xfirst } ifelse } { % % no last name, check first % trim isnull { % % no info of any kind % pop } { % % has first name % dup !Cust.First !Cust.Xfirst } ifelse } ifelse } ifelse /* % % first, determine if any of the words is a keyword % at the beginning of the line % % stack: [ [|]token . . . ] count % { pos( { dup index -1 left lower "anly" log)( < |name % % a gender prefix may still be part of name token series % dup + -1 roll pop - pos( { *splitnam } if |email % % parse the next word as the email address % dup + -1 roll pop - pos( { *spliteml } if > { false } { % % not in the list of labels % this is a message for shooter % % stack: [ [|]token . . . ] count % true } ifelse } { % % no significant message % % stack: % true } ifelse ? } loop popoff */