[Tutor] Difficult loop?

Emad Nawfal (عماد نوفل) emadnawfal at gmail.com
Thu Oct 16 02:15:55 CEST 2008


That's great.
There is still only one thing that I was not aware of when I asked the
question.
When the double consonant sign  "~" is there, it should slo be skipped like
the short vowels. In other words, it cannot appear except in the pre-final
position along with another short vowel.
Is that easy to fix?

One more question,
I'm a linguistics person, I know some Java and some Python (and failed to
learn Prolog). What things do I need to learn to write such "difficult"
scripts? Are there any recommendations? books, certain things to learn?

To see how my friend's script was used, just look at the paper in this link:
http://jones.ling.indiana.edu/~skuebler/papers/vocal.pdf

Thank you so much,
Emad

2008/10/15 John Fouhy <john at fouhy.net>

> 2008/10/16 Emad Nawfal (عماد نوفل) <emadnawfal at gmail.com>:
> > The focus  letter will always be # 6 on the line. A is not a short vowel,
> > and it is not followed by a short vowel, so the last character should be
> > "_", not a "u"
>
> Oh, I see.  I misunderstood the meaning of "followed by".  I can fix
> that by changing one function in my code:
>
> def nextSV(s, idx):
>    """ Find the next short vowel, or ~ + short vowel.
>
>    s :: string to search
>    idx :: index to start from
>
>    Return: short vowel, or ~ + short vowel, or _ if no following short
> vowel.
>    """
>
>     try:
>        if s[idx+1] in shortVowels:
>            return s[idx+1]
>        elif s[idx+1] == double:
>            return s[idx+1:idx+3]
>        else:
>            return '_'
>    except IndexError:
>        return '_'
>
> > The purpose of this program is to calculate vector similarities in the
> > context of the letters in a machine learning approach called
> "Memory-based
> > learning"
>
> I did wonder what it was for ;-)
>
> --
> John.
>



-- 
لا أعرف مظلوما تواطأ الناس علي هضمه ولا زهدوا في إنصافه كالحقيقة.....محمد
الغزالي
"No victim has ever been more repressed and alienated than the truth"

Emad Soliman Nawfal
Indiana University, Bloomington
http://emnawfal.googlepages.com
--------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081015/b8c6435e/attachment-0001.htm>


More information about the Tutor mailing list