[lojban] scoreGismu

17 views
Skip to first unread message

tijlan

unread,
Apr 23, 2010, 9:52:33 PM4/23/10
to loj...@googlegroups.com
This may well sound a very newbie question to experienced programmers.

After I installed the newest version of ActivePerl, I tried, via my Windows 7's command prompt, to load a text file (containing source words for my experimental gismu) into scoreGismu.pl (created by Hussell, if I remember correctly) with this command:
 filename.txt scoreGismu.pl
It opens the text file in Notepad, but the scoring doesn't start in the command prompt window like it used to do in my Windows XP. My hunch is that I entered a wrong command. Please educate me.

I'm also wondering if this program could be browser-based.

mu'o lo skami bangu certu mi'e le cfipu lanme

--
You received this message because you are subscribed to the Google Groups "lojban" group.
To post to this group, send email to loj...@googlegroups.com.
To unsubscribe from this group, send email to lojban+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lojban?hl=en.

István Lakatos

unread,
Apr 24, 2010, 12:02:20 AM4/24/10
to loj...@googlegroups.com
I think you wrote the command in the wrong order. It should be scoreGismu.pl filename.txt

Robert Slaughter

unread,
Apr 23, 2010, 11:51:42 PM4/23/10
to loj...@googlegroups.com
The typical order is "command/program filename", so
C:\>scoreGismu.pl filename.txt
should work.

-- 
Bob Slaughter, rslau...@WHATmindspring.com
http://www.mindspring.com/~rslau/
North Georgia Modurail: http://www.trainweb.org/northgamodurail/
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing." -- Albert Einstein<
"The price good men pay for indifference to public affairs is to be ruled by evil men." -- Plato

tijlan

unread,
Apr 24, 2010, 3:58:01 AM4/24/10
to loj...@googlegroups.com
On 24 April 2010 04:51, Robert Slaughter <rs...@mindspring.com> wrote:
The typical order is "command/program filename", so
C:\>scoreGismu.pl filename.txt
should work.

2010/4/24 István Lakatos <lakato...@gmail.com>

I think you wrote the command in the wrong order. It should be scoreGismu.pl filename.txt

I had tried that. The line breaks onto a new empty one (with no "C:\"), unable to go back with Backspace or "cd". I tried also different text files including the ones which scoreGismu.pl on Windows XP used to load and successfully score.

I'll attach the program to this message.
scoreGismu.pl

Ben Birt

unread,
Apr 24, 2010, 7:33:37 AM4/24/10
to loj...@googlegroups.com
I've never used Perl, but I'd expect the command to be something like "perl scoreGismu.pl filename.txt".

tijlan

unread,
Apr 24, 2010, 10:00:43 AM4/24/10
to loj...@googlegroups.com
On 24 April 2010 12:33, Ben Birt <benjam...@googlemail.com> wrote:
I've never used Perl, but I'd expect the command to be something like "perl scoreGismu.pl filename.txt".

It returns this:
{ 'perl' is not recognized as an internal or external command, operable program or batch file. }

If I enter only "scoreGismu.pl", the window title changes from "Command Prompt" to "Command Prompt - scoreGismu.pl", so it does seem to recognise the program this way, but I get a new empty line again in which no command seems able to effectuate anything.

Ben Birt

unread,
Apr 24, 2010, 2:49:12 PM4/24/10
to loj...@googlegroups.com
In that case, perl is probably not in your PATH variable. You *probably* need to either:

1) put the directory path to the perl executable in your PATH variable (there should be pretty easy-to-find instructions to find via Google for this).
2) run perl using the whole of its directory path in front of the perl command (e.g. "C:\Perl\perl.exe scoreGismu.pl filename.txt")

Pierre Abbat

unread,
Apr 24, 2010, 3:26:14 PM4/24/10
to loj...@googlegroups.com
On Saturday 24 April 2010 10:00:43 tijlan wrote:
> On 24 April 2010 12:33, Ben Birt <benjam...@googlemail.com> wrote:
> > I've never used Perl, but I'd expect the command to be something like
> > "perl scoreGismu.pl filename.txt".
>
> It returns this:
> { 'perl' is not recognized as an internal or external command, operable
> program or batch file. }

When I first tried to run it, I got this error:
bash: /tmp/scoreGismu.pl: /usr/bin/perl^M: bad interpreter: No such file or
directory
The reason is that all the lines ended with a carriage return and line feed,
instead of just a line feed. Once I fixed that, I got a Perl error, "Can't
locate Algorithm/Diff.pm". That I haven't fixed; I have to install some Perl
module.

What's the program supposed to do? I don't see any comments in it.

Pierre
--
.i toljundi do .ibabo mi'afra tu'a do
.ibabo damba do .ibabo do jinga
.icu'u la ma'atman.

tijlan

unread,
Apr 24, 2010, 5:32:02 PM4/24/10
to loj...@googlegroups.com
On 24 April 2010 19:49, Ben Birt <benjam...@googlemail.com> wrote:
In that case, perl is probably not in your PATH variable. You *probably* need to either:

1) put the directory path to the perl executable in your PATH variable (there should be pretty easy-to-find instructions to find via Google for this).
2) run perl using the whole of its directory path in front of the perl command (e.g. "C:\Perl\perl.exe scoreGismu.pl filename.txt")

The second option worked! Thank you very much.

tijlan

unread,
Apr 24, 2010, 5:56:59 PM4/24/10
to loj...@googlegroups.com
On 24 April 2010 20:26, Pierre Abbat <ph...@phma.optus.nu> wrote:
What's the program supposed to do? I don't see any comments in it.

It loads a set of Lojbanized source words plus an optional weighting like

 iun 0.347 upiog 0.196 emploi 0.160 us 0.123 primin 0.089 amal 0.085 (it's the actual etymology of "pilno")

and score every possible gismu (80,000+) in regard to these source words. The source languages need not be the conventional ones and can be more than six.

It doesn't always score with the same result as for an official gismu. For instance, the gismu with the highest score of 0.4767... in regard to the above source words is "mlino" according to this program, not "pilno", even with the older weighting:

 iun 0.36 emploi 0.21 upiog 0.16 us 0.11 primin 0.09 amal 0.07

Minimiscience

unread,
Apr 24, 2010, 6:43:17 PM4/24/10
to loj...@googlegroups.com
de'i li 24 pi'e 04 pi'e 2010 la'o fy. tijlan .fy. cusku zoi skamyxatra.
> It doesn't always score with the same result as for an official gismu. For
> instance, the gismu with the highest score of 0.4767... in regard to the
> above source words is "mlino" according to this program, not "pilno", even
> with the older weighting:
>
> iun 0.36 emploi 0.21 upiog 0.16 us 0.11 primin 0.09 amal 0.07
.skamyxatra

That's because the script doesn't implement step 2b of the {gismu} creation
algorithm correctly. This can be fixed by changing lines 114-118 from:

> if($gismu =~ /$lcs[0].?$lcs[1]/) {
> if($word =~ /$lcs[0].?$lcs[1]/) {
> $score += $weight * 2 / @wordSequence;
> }
> }

to:

> $score += $weight * 2 / @wordSequence
> if $gismu =~ /$lcs[0]$lcs[1]/ && $word =~ /$lcs[0]$lcs[1]/
> || $gismu =~ /$lcs[0].$lcs[1]/ && $word =~ /$lcs[0].$lcs[1]/

You'll also need to have an empty file in place of gismu.txt in order for
extant {gismu} (and anything they conflict with) to be considered for scoring.

mu'omi'e .kamymecraijun.

--
mi na se finti fi tu'a lo vi munje
Reply all
Reply to author
Forward
0 new messages