Re: TECH: Sound Change program
From: | Paul Bennett <paul-bennett@...> |
Date: | Friday, March 25, 2005, 2:18 |
On Thu, 24 Mar 2005 20:50:37 -0500, David J. Peterson <dedalvs@...>
wrote:
> Paul wrote:
> <<
> from > to / environment
>
> such as:
>
> d > t / _ #
> >>
>
> First, it's great to hear you're undertaking this tack. Right on!
Woo!
> I actually have something that does exactly this, and the *most*
> annoying thing about it is that only A > B / C_D is understood.
[snip example of annoyingness]
> So, if your program could understand user-designed variables (e.g.,
> it understands that "a, e, i, o and u" are V if you say so), and *maybe*
> features (that might be too hard), or at least have a way to deal with
> features, that would be a significant improvement.
Well, the language has pattern matching using fairly traditional []
notation, so I could do
p > b / [aeiou]_[aeiou]
with very few problems, if any.
The problem with named variables, and features for that matter, is that
they (may) change from one stage of the language to the next. I'd need
another file with (e.g.)
1066:
V=aeiou
1300:
V=aeiouy
Also, I'd need some kind of escape mechanism to distinguish named
variables from text, since it's plausible that the user would want to use
some horrible language like Klingon (or indeed CXS), where upper and lower
case can mix within plain text.
I've thought about using $ before variables, to keep in step with several
programming and scripting languages, but $ is used in environments for
"morpheme boundary", and it would be a shame to have to use $$ there.
Features, similarwise. if I used [aeiou] notation for variables, I'd need
some other mechanism for marking features, and a file that looks something
like
1066:
t=[+stop][+alveolar][-voice]
Okay, I'm thinking on my feet here...
Make the sound-change file reader multi-pass.
First pass, gobble up all the [features] and re-mark with some other
character, like `feature' or something. Second pass, take all the
(variables) and rewrite them in [regex notation].
Hmm...
Thinking is occuring...
Ack! Another notation I want to write down before I forget it:
1066:
C[voice]
+=bdgj
-=ptkc
Paul
Replies