Page 4 of 8

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 15, 2017 6:01 pm
by bn
the question mark

here is a stack that inserts a back script. Click on button "setBackScript" and it will insert the script of button "bBack" into back.

The stack has it's destroyStack property set so closing the stack will remove it from memory. You could easily trigger the insertion in a opencard script and then close the stack right away. Or make it a plugin that start when LC starts and add a script that it closes right away.

Now type a ? and a keyword in quotes into the message box. It will put the unformatted data for the keyword into the message box.

Currently it retuns the
Display name
Syntax
Summary
Example
Description

Kind regards
Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 15, 2017 7:06 pm
by bn
Sorry, I was wrong, the stack that inserts a handler for the ? "Keyword" from the dictionary has to stay open for the backscript to work.
Actually this is my first attempt at a back script, usually I try to stay inside my stacks.

Kind regards
Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 15, 2017 8:35 pm
by capellan
Amazing Bernd! :D

Many, many thanks for posting this utility.
Later, today, I will install it in Windows
and Linux.

Al

Re: Dictionary rewrite - thoughts, please

Posted: Fri Feb 17, 2017 12:18 am
by keithglong
Nice work Bernd! Thanks for sharing.

Cheers,

Keith "Boo" Long
Gulf Breeze, Florida

Re: Dictionary rewrite - thoughts, please

Posted: Fri Feb 17, 2017 12:28 am
by capellan
Works great in LC 8 and 9! :D

How could I retrieve a list of all entries in the dictionary,
like some kind of index?

Re: Dictionary rewrite - thoughts, please

Posted: Fri Feb 17, 2017 1:06 am
by bn
Hi Alejandro,

Code: Select all

local sAllArray

on mouseUp
   getNameListFromDict
end mouseUp

on getNameListFromDict
   dispatch ideDocsFetchLCSEntries() to stack "revIDEDocumentationLibrary"
   put the result into sAllArray
   if sAllArray is not an array then 
      put "something went wrong" && the milliseconds
      exit getNameListFromDict
   end if
   repeat for each key aKey in sAllArray
      put sAllArray[aKey]["display name"] & cr after tCollect
   end repeat
   delete last char of tCollect -- a return
   sort tCollect 
   put tCollect
end getNameListFromDict
Kind regards
Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Fri Feb 17, 2017 6:31 am
by capellan
Works great! :D
Thanks a lot

Re: Dictionary rewrite - thoughts, please

Posted: Sat Feb 18, 2017 1:02 pm
by Mikey
So, Bernd, are you continuing to run with this? I so, I'm going to cross it off my list and just make suggestions, as they come up. I like where it's going, and you've certainly made more progress, more quickly than I could have.

Re: Dictionary rewrite - thoughts, please

Posted: Sat Feb 18, 2017 5:11 pm
by bn
Mikey,

here is version 0.6 of the attempt...

It now has linked text (the cursor changes to hand over the links) but no history yet.

Formatting the raw data, especially links, took me a while and is not perfect yet.

Double clicking on the details field now pops up the details field to full height and low an behold, there is at the right upper corner a X that you can click to hide it. Also ESC will hide the popped up details field.

You might want to give this a try.

Comments as always welcome.

Kind regards
Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Sat Feb 18, 2017 7:29 pm
by Mikey
1) At least on a Mac, there is a rendering issue for the top line when you open. See attached
2) When I double-click on an entry, I get full-window, but the "X" only shows the first time I do that (beyond that, no "X"), and the esc key doesn't work unless I click inside the full-sized field, first.

This is looking pretty sweet!

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 22, 2017 10:05 pm
by bn
Hi all,

here is a new version of a dictionary.
newVersion.png
for those that don't find the attachment below
newVersion.png (6.48 KiB) Viewed 41294 times
DictionarySplitter_0_7_5_2.livecode.zip
(51.24 KiB) Downloaded 489 times

I think I got the topLine issue nailed and also the popUp / ESC button for the details field on double-click.

The links now work better but still not allright, I probably have to rewrite the parsing for the click-links.
Problems are links on details to dictionary entries for <, >, <>, <=, >= which are hard to tell from the mark up signs in the raw data.

New is a History of visited entries. I hope it is self explanatory.

Kind regards

Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 22, 2017 10:47 pm
by capellan
Works great in Windows! :D
Just one thing: I could see a small square after every line.
This small square was not visible in previous versions.

By the way, How could I read in a single text document
every example of all Dictionary entries?

I would like to test all these examples using a field
with a script like: "do the clickline of fld "dictionaryexamples"

Re: Dictionary rewrite - thoughts, please

Posted: Wed Feb 22, 2017 11:20 pm
by bn
Thanks Alejandro,

What you see in Windows a small square is an "invisible" (at least on a Mac) sign I started to use to mark sections. When I rewrite the parsing I will probably get rid of it.
By the way, How could I read in a single text document
every example of all Dictionary entries?

I would like to test all these examples using a field
with a script like: "do the clickline of fld "dictionaryexamples"
I don't understand what exactly you are trying to do. Do you want to test the script examples? They are not all functional. It is planned that all examples will compile and work. Devin Asay is doing a great job reworking the dictionary and also the examples.

Please explain what you have in mind.

Kind regards
Bernd

Re: Dictionary rewrite - thoughts, please

Posted: Thu Feb 23, 2017 3:12 am
by Mikey
Someone is having waaaaaaaaaay too much fun with this.
Looks good and works good on a Mac. The previous bugs all seem to be gone.

Re: Dictionary rewrite - thoughts, please

Posted: Thu Feb 23, 2017 3:45 am
by Brahmanathaswami
I've been away working on editorial/print production... just came back here. Wow! thanks Bernd for your hard work... working here on my Mac! R U planning filters in the empty column on the left? Where we only see 'theme switcher now.

IN most of my in house apps I use a double search/filter routine, as I find this help offer some "fuzzy logic" to searching. it is very often the case that we don't know exactly what we are looking for, so i will build in very "loose" search params where searchString1 filters all results and then searchString2 filters those results, This is better most users than Boolean "AND" or "OR in a single search text field, both of these get too many extraneous results.

I give users two fields. and the search goes through all text e.g. enter "mobile" in searchstring1 and "transition" in searchString2

if you really don't know what you are looking for you can do short terms like "mobile" "vis" and the would bring up all entries where those two strings are present *anywhere* in the entry.