cpsolver/Dashrep-language

Should a Dashrep script have an entry point?

xtradev opened this issue · 1 comments

Hello,

I am studying Dashrep. I understand the general concept and want to clarify some points.
I'm running Dashrep 2.33 installed via ActivePerl v5.18.2 package manager on Windows XP SP3.

Is it necessary to have an entry point for a script to start the expansion?
For example, here http://dashrep.org/cgi-bin/dashrep_demo.cgi the Dashrep code starts with dashrep-definitions-begin and ends with dashrep-definitions-end. Nothing beyond. If I run it in a browser it shows:

Welcome to our menagerie.  We have
four fish that are wet,
one cat that is aloof,
two parrots that are talkative,
and five rabbits that are cute.

If I copy-paste the same code in a local file and then run it locally, Dashrep produces nothing.

I conclude - there is no an entry point. So I append phrase-to-expand after dashrep-definitions-end. Then in a browser it returns nothing. And locally Dashrep 2.33 returns:

first-item-animal-id = from-phrase-get-word-number: 3 4 1 2 1 last-item-animal-id = from-phrase-get-word-number: 3 4 1 2 count-of-words-in-phrase: 3 4 1 2 use-template-and-parameters-to-create-full-list-with-name: [-parameter-animal-id = [-createlist-parameter-]-] [-ex-language-id-]-word-[-and-or-no-word-match-first-[-same-or-not-same: [-parameter-animal-id-]-[-first-item-animal-id-]-]-and-match-last-[-same-or-not-same: [-parameter-animal-id-]-[-last-item-animal-id-]-]-] [-ex-language-id-]-word-for-number-[-db-animal-count-for-animal-id-[-parameter-animal-id-]-] [-ex-language-id-]-word-animal-name-[-singular-or-plural-for-count-category-[-zero-one-multiple: [-db-animal-count-for-animal-id-[-parameter-animal-id-]-]-]-]-for-animal-id-[-parameter-animal-id-] [-ex-language-id-]-word-that [-ex-language-id-]-word-is-are-[-zero-one-multiple: [-db-animal-count-for-animal-id-[-parameter-animal-id-]-]-] [-ex-language-id-]-words-characteristic-[-singular-or-plural-for-count-category-[-zero-one-multiple: [-db-animal-count-for-animal-id-[-parameter-animal-id-]-]-]-]-for-animal-id-[-parameter-animal-id-] 3 4 1 2 animal-phrases Welcome to our menagerie.  We have wording-for-animal-count-zero-one-multiple: count-of-words-in-phrase: 3 4 1 2.

I downloaded the latest Dashrep 3.00 from here (GitHub). It returns:

C:\Inbox\Dashrep! perl dashrep_do_translation.pl < C:\Practice\Dashrep\animals.rep
Welcome to our menagerie.  We have
en-word- and-or-no-word-match-first- same-or-not-same 3-3 -and-match-last- same-or-not-same 3-2 four fish that are wet,
en-word- and-or-no-word-match-first- same-or-not-same 4-3 -and-match-last- same-or-not-same 4-2 one cat that is aloof,
en-word- and-or-no-word-match-first- same-or-not-same 1-3 -and-match-last- same-or-not-same 1-2 two parrots that are talkative,
en-word- and-or-no-word-match-first- same-or-not-same 2-3 -and-match-last- same-or-not-same 2-2 five rabbits that are cute.

So I could not get locally what I get in a browser.

Thank you for exploring the Dashrep language!

Based on your interest I have updated the demo, both in terms of using the current version of the Dashrep engine, and in terms of updating the demo Dashrep code, which no longer worked with the current version.

The incorrect results you got were caused by the demo running an old version of the Dashrep engine and the now-outdated Dashrep code in the demo. That is now fixed.

As for a starting point, it starts with a line of Perl code that calls a Dashrep subroutine, and those subroutines are documented within the code.

Again, thank you for your interest!

P.S. As stated in the documentation for the CPAN version (and as you have noticed), the CPAN version is NOT up-to-date. (It does work, but it's an old version of Dashrep.) I no longer have a CPAN environment in which to test the CPAN version (which gets generated from the GitHub version).