Bidirectional Dictionary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Bidirectional Dictionary

KenDickey
Greetings,

I did a simple Interlingua <--> English lookup window.

IEDictWindow>>buildMorphicWindow is an example of LayoutMorph / LayoutSpec usage in a SystemWindow.

You can get the code from GitHub:

        https://github.com/KenDickey/Cuis-Ia-En


I usually first load the package into an image and then open the window:

"----Workspace----"
{ '../Cuis-Ia-En/Interlingua.pck' .
} do:  [ :fileName | CodeFileBrowser installPackage:
               (FileStream concreteStream readOnlyFileNamed: fileName)].

IEDictWindow open. "DoIt after the package code is loaded"

"-----------------"

IEDict>>WhyMe gives some sample Interlingua and references to more information on Interlingua on the web.


The above brings up a couple of issues.

The class initialization code loads a dictionary file ("iedict.txt") from a sibling directory to the CUIS directory.

In other words I have a Cuis directory git-cloned from CUIS and a sibling Cuis-Ia-En directory git-cloned from the above.

Currently, the class initialization code in IEDict loads
        FileStream oldFileNamed: '../Cuis-Ia-En/iedict.txt'.

Note also the relative path in the package loading workspace code above.

I could make the relative directory path an IEDict class variable to make it easier to change, but I am wondering if there is a convention that we could adopt (e.g. that we can assume sibling-level directory access).

What do you all think is the cleanest way to handle this type of dependency within the Git based package framework?


Another Git issue.  I am currently loading change sets for the image and updating
  SystemVersion current highestUpdate
manually.

It would be good if loading a changeSet kept the SystemVersion up to date automagically.  E.g. I would prefer that loading changeSets through, say
  '1549-ChangeSorterEnh-JuanVuletich-2013Jan05-22h41m-jmv.1.cs.st'.
would set the SystemVersion to 1549.


Enjoy!
-KenD
--
Ken Dickey <Ken.Dickey [at] whidbey.com>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

Hannes Hirzel
On 1/8/13, Ken Dickey <[hidden email]> wrote:

> Greetings,
>
> I did a simple Interlingua <--> English lookup window.
>
> IEDictWindow>>buildMorphicWindow is an example of LayoutMorph / LayoutSpec
> usage in a SystemWindow.
>
> You can get the code from GitHub:
>
> https://github.com/KenDickey/Cuis-Ia-En
>
>
> I usually first load the package into an image and then open the window:
>
> "----Workspace----"
> { '../Cuis-Ia-En/Interlingua.pck' .
> } do:  [ :fileName | CodeFileBrowser installPackage:
>                (FileStream concreteStream readOnlyFileNamed: fileName)].
>
> IEDictWindow open. "DoIt after the package code is loaded"
>
> "-----------------"
>
> IEDict>>WhyMe gives some sample Interlingua and references to more
> information on Interlingua on the web.


Ken, great to see you working on this.

I did a fork, https://github.com/hhzl/Cuis-Ia-En

then I changed two things and did a pull request.

    https://github.com/KenDickey/Cuis-Ia-En/pull/1

--Hannes

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

KenDickey
In reply to this post by KenDickey
> I did a fork, https://github.com/hhzl/Cuis-Ia-En
>
> then I changed two things and did a pull request.
>
>    https://github.com/KenDickey/Cuis-Ia-En/pull/1

Hannes,

Thanks for the updates!  Much better comment!

I am just starting out with Git and have a lot to learn.

Cheers,
-KenD
--
Ken Dickey <Ken.Dickey [at] whidbey.com>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

Juan Vuletich-4
In reply to this post by KenDickey
Hi Ken,

Ken Dickey wrote:
> Greetings,
>
> I did a simple Interlingua <--> English lookup window.
>
> ...
>  

This is way cool!

> In other words I have a Cuis directory git-cloned from CUIS and a sibling Cuis-Ia-En directory git-cloned from the above.
>
> Currently, the class initialization code in IEDict loads
> FileStream oldFileNamed: '../Cuis-Ia-En/iedict.txt'.
>
> Note also the relative path in the package loading workspace code above.
>
> I could make the relative directory path an IEDict class variable to make it easier to change, but I am wondering if there is a convention that we could adopt (e.g. that we can assume sibling-level directory access).
>
> What do you all think is the cleanest way to handle this type of dependency within the Git based package framework?
>  

Sounds good to me. Sibling folder is a good idea.

> Another Git issue.  I am currently loading change sets for the image and updating
>   SystemVersion current highestUpdate
> manually.
>
> It would be good if loading a changeSet kept the SystemVersion up to date automagically.  E.g. I would prefer that loading changeSets through, say
>   '1549-ChangeSorterEnh-JuanVuletich-2013Jan05-22h41m-jmv.1.cs.st'.
> would set the SystemVersion to 1549.
>
>  

Indeed! I must fix this. I hope to be able to fix it soon.

Thanks,
Juan Vuletich

> Enjoy!
> -KenD
>  


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

Juan Vuletich-4
Juan Vuletich wrote:

> Hi Ken,
>
> Ken Dickey wrote:
>> ...
>>
>> It would be good if loading a changeSet kept the SystemVersion up to
>> date automagically.  E.g. I would prefer that loading changeSets
>> through, say
>>   '1549-ChangeSorterEnh-JuanVuletich-2013Jan05-22h41m-jmv.1.cs.st'.
>> would set the SystemVersion to 1549.
>>
>>  
>
> Indeed! I must fix this. I hope to be able to fix it soon.
>
> Thanks,
> Juan Vuletich
>

Just checked. It already does it, if you install the change sets using
the [ install ] button on the FileList, and not (for example) the [
fileIn ] button. Mhhh. These two buttons are a bit redundant. Maybe we'd
keep just [ install ] for change set files (.cs.st), and just [ fileIn ]
for other kinds of source files.

What do you think?

Cheers,
Juan Vuletich

>> Enjoy!
>> -KenD
>>  
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

garduino


2013/1/11 Juan Vuletich <[hidden email]>
Juan Vuletich wrote:

Just checked. It already does it, if you install the change sets using the [ install ] button on the FileList, and not (for example) the [ fileIn ] button. Mhhh. These two buttons are a bit redundant. Maybe we'd keep just [ install ] for change set files (.cs.st), and just [ fileIn ] for other kinds of source files.

What do you think?

Yes, have sense, with .mcz is te same thing, Install or FileIn do both the same thing.

 

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Install vs FileIn [WAS Re: Bidirectional Dictionary]

KenDickey
In reply to this post by Juan Vuletich-4
Ah!

Given the large number of updates, I was using a script to load them all and had used #fileIn: rather than #install: .

A sentence about SystemVersion and a bit of sample code added to the "Code Management in Cuis 4.0" web page would have helped me out.

Packages:

  SystemVersion current highestUpdate. "--> 1549"
  packageFileNameList do:
   [:packageNameStr | FileStream fileIn: packageFileNameStr ].
  SystemVersion current highestUpdate. "--> 1549"

Updates:

  SystemVersion current highestUpdate. "--> 1511"
  updateFileNameList do:
   [:changeFileNameStr | FileStream install: ( 'UpdatesSinceLastRelease', slash, changeFileNameStr) ].
  SystemVersion current highestUpdate. "--> 1549"


On the other hand, I am unsure of putting too much detail in the code management page.

Perhaps we should save these things for a Cuis Cookbook?

Cheers,
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

Hannes Hirzel
In reply to this post by garduino
Is is possible to distinguish between a *.cs.st which is a regular
update to Cuis and another *.cs.st which is just an add-on? If yes,
only one button would be needed.

--Hannes

On 1/11/13, Germán Arduino <[hidden email]> wrote:

> 2013/1/11 Juan Vuletich <[hidden email]>
>
>> Juan Vuletich wrote:
>>
>> Just checked. It already does it, if you install the change sets using
>> the
>> [ install ] button on the FileList, and not (for example) the [ fileIn ]
>> button. Mhhh. These two buttons are a bit redundant. Maybe we'd keep just
>> [
>> install ] for change set files (.cs.st), and just [ fileIn ] for other
>> kinds of source files.
>>
>> What do you think?
>>
>
> Yes, have sense, with .mcz is te same thing, Install or FileIn do both the
> same thing.
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Install vs FileIn [WAS Re: Bidirectional Dictionary]

Hannes Hirzel
In reply to this post by KenDickey
On 1/11/13, KenD <[hidden email]> wrote:
> Ah!
>
> Given the large number of updates, I was using a script to load them all and
> had used #fileIn: rather than #install: .
>
> A sentence about SystemVersion and a bit of sample code added to the "Code
> Management in Cuis 4.0" web page would have helped me out.

Thank you for sharing the result of your findings. Very convenient.


> Packages:
>
>   SystemVersion current highestUpdate. "--> 1549"
>   packageFileNameList do:
>    [:packageNameStr | FileStream fileIn: packageFileNameStr ].
>   SystemVersion current highestUpdate. "--> 1549"
>
> Updates:
>
>   SystemVersion current highestUpdate. "--> 1511"
>   updateFileNameList do:
>    [:changeFileNameStr | FileStream install: ( 'UpdatesSinceLastRelease',
> slash, changeFileNameStr) ].
>   SystemVersion current highestUpdate. "--> 1549"


How did you create the
   updateFileNameList
?

>
> On the other hand, I am unsure of putting too much detail in the code
> management page.

I would not mind finding the code snippets above at that page.




> Perhaps we should save these things for a Cuis Cookbook?

Yes, maybe even just in the README.md file or another file like
'Notes.md' until there is more.

--Hannes

> Cheers,
> -KenD
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Install vs FileIn [WAS Re: Bidirectional Dictionary]

KenDickey
In reply to this post by KenDickey
On Sat, 12 Jan 2013 05:41:25 +0000
"H. Hirzel" <[hidden email]> wrote:

> How did you create the
>    updateFileNameList
> ?

I open the image in the Cuis directory, so the following works:

(FileDirectory default directoryNamed: 'UpdatesSinceLastRelease') fileNames.


-KenD


--
Ken Dickey <[hidden email]>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Install vs FileIn [WAS Re: Bidirectional Dictionary]

Juan Vuletich-4
In reply to this post by KenDickey
KenD wrote:

> Ah!
>
> Given the large number of updates, I was using a script to load them all and had used #fileIn: rather than #install: .
>
> A sentence about SystemVersion and a bit of sample code added to the "Code Management in Cuis 4.0" web page would have helped me out.
>
> Packages:
>
>   SystemVersion current highestUpdate. "--> 1549"
>   packageFileNameList do:
>    [:packageNameStr | FileStream fileIn: packageFileNameStr ].
>   SystemVersion current highestUpdate. "--> 1549"
>
> Updates:
>
>   SystemVersion current highestUpdate. "--> 1511"
>   updateFileNameList do:
>    [:changeFileNameStr | FileStream install: ( 'UpdatesSinceLastRelease', slash, changeFileNameStr) ].
>   SystemVersion current highestUpdate. "--> 1549"
>
>
> On the other hand, I am unsure of putting too much detail in the code management page.
>
> Perhaps we should save these things for a Cuis Cookbook?
>
>  

Good idea.

Cheers,
Juan Vuletich

> Cheers,
> -KenD
>
>
>  


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

Hannes Hirzel
In reply to this post by Hannes Hirzel
Ken

I did a pull request to make it load under MSWindows

    https://github.com/KenDickey/Cuis-Ia-En/pulls

Need for specifying the path OS independently.

The dictionary is a nice demonstration how to build a simple GUI with
just a few lines of code. Thank you for coming up with this.

Sincerely
--Hannes

On 1/12/13, H. Hirzel <[hidden email]> wrote:

> Is is possible to distinguish between a *.cs.st which is a regular
> update to Cuis and another *.cs.st which is just an add-on? If yes,
> only one button would be needed.
>
> --Hannes
>
> On 1/11/13, Germán Arduino <[hidden email]> wrote:
>> 2013/1/11 Juan Vuletich <[hidden email]>
>>
>>> Juan Vuletich wrote:
>>>
>>> Just checked. It already does it, if you install the change sets using
>>> the
>>> [ install ] button on the FileList, and not (for example) the [ fileIn ]
>>> button. Mhhh. These two buttons are a bit redundant. Maybe we'd keep
>>> just
>>> [
>>> install ] for change set files (.cs.st), and just [ fileIn ] for other
>>> kinds of source files.
>>>
>>> What do you think?
>>>
>>
>> Yes, have sense, with .mcz is te same thing, Install or FileIn do both
>> the
>> same thing.
>>
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Bidirectional Dictionary

KenDickey
On Mon, 14 Jan 2013 09:03:38 +0000
"H. Hirzel" <[hidden email]> wrote:

> I did a pull request to make it load under MSWindows

Thanks much for the fix!


> The dictionary is a nice demonstration how to build a simple GUI with
> just a few lines of code. Thank you for coming up with this.

You are very welcome.

-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Install vs FileIn [WAS Re: Bidirectional Dictionary]

Hannes Hirzel
In reply to this post by Juan Vuletich-4
Hello

what is nice about the latest updates up to 4.1-1561 is that there is
only one button in the file browser

      FileListWindow openFileList


to install *.pck.st files or updates (*.cs.st).


However the class FileStream does no longer have an #install: and a
#fileIn: method.

Need to fix the load scripts...

--Hannes

On 1/13/13, Juan Vuletich <[hidden email]> wrote:

> KenD wrote:
>> Ah!
>>
>> Given the large number of updates, I was using a script to load them all
>> and had used #fileIn: rather than #install: .
>>
>> A sentence about SystemVersion and a bit of sample code added to the "Code
>> Management in Cuis 4.0" web page would have helped me out.
>>
>> Packages:
>>
>>   SystemVersion current highestUpdate. "--> 1549"
>>   packageFileNameList do:
>>    [:packageNameStr | FileStream fileIn: packageFileNameStr ].
>>   SystemVersion current highestUpdate. "--> 1549"
>>
>> Updates:
>>
>>   SystemVersion current highestUpdate. "--> 1511"
>>   updateFileNameList do:
>>    [:changeFileNameStr | FileStream install: ( 'UpdatesSinceLastRelease',
>> slash, changeFileNameStr) ].
>>   SystemVersion current highestUpdate. "--> 1549"
>>
>>
>> On the other hand, I am unsure of putting too much detail in the code
>> management page.
>>
>> Perhaps we should save these things for a Cuis Cookbook?
>>
>>
>
> Good idea.
>
> Cheers,
> Juan Vuletich
>
>> Cheers,
>> -KenD
>>
>>
>>
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org