viresh-ratnakar / exet

Web app for crossword construction: designing a grid, filling the grid, creating straight or cryptic clues, and downloading as Exolve or .puz. All data is saved locally, no crosswords are sent to any server.
https://viresh-ratnakar.github.io/exet.html
MIT License
43 stars 12 forks source link

Search nutrimatic / onelook / ??? for fill #32

Closed mooomooo closed 3 months ago

mooomooo commented 3 months ago

In place of / to supplement a custom lexicon (#3), it might be nice to have the ability to directly search nutrimatic / onelook for fill that match the currently filled in length and crossers. Perhaps a button to append the search results to the list from the lexicon, or a separate tab in the word list, or just additional entries in the "research" tab?

Thanks for this amazing tool!

viresh-ratnakar commented 3 months ago

Thanks! Yes, that's a very good idea. Thinking aloud a bit about the details (inputs from anyone are welcome): Nutrimatic results in general will be low-precision/high-recall (as many/most of the phrase matches will not be usable), so I wouldn't want to just mix them into the lexicon matches. I think additional entries in the "Research" tab seems like the easiest thing to do as well as the right way to do it.

viresh-ratnakar commented 3 months ago

BTW: there are many times when it would be nice to get weigh-ins from more users, and I find that rarely happening on GitHub Issue/Discussion area. So I've now created a Google Group. Do consider joining: https://groups.google.com/g/exolve-exet-etc

mooomooo commented 3 months ago

(Github is easier for me than Google Groups) From the group:

I am thinking of removing the "Clear light" button that is currently shown in the Exet tab, above the grid-fill choices. I will add it to the Edit menu. The keyboard short-cut (Ctrl-q) will continue to work. I am thinking of using that space to offer a choice of fetching grid-fill matches from sources such as Nutrimatic and Onelook (to supplement what you get from the lexicon: see https://github.com/viresh-ratnakar/exet/issues/32).

I think this sounds like a better idea actually, though probably more work -- it makes more sense for the words to show up in this tab than under "Research". I do see your point about not mixing results though, so maybe the word list choices box could be made to have separate tabs for lexicon / nutrimatic / onelook matches?

viresh-ratnakar commented 3 months ago

On Tue, Jun 4, 2024 at 4:21 PM mooomooo @.***> wrote:

(Github is easier for me than Google Groups) From the group:

I am thinking of removing the "Clear light" button that is currently shown in the Exet tab, above the grid-fill choices. I will add it to the Edit menu. The keyboard short-cut (Ctrl-q) will continue to work. I am thinking of using that space to offer a choice of fetching grid-fill matches from sources such as Nutrimatic and Onelook (to supplement what you get from the lexicon: see #32 https://github.com/viresh-ratnakar/exet/issues/32).

I think this sounds like a better idea actually, though probably more work -- it makes more sense for the words to show up in this tab than under "Research". I do see your point about not mixing results though, so maybe the word list choices box could be made to have separate tabs for lexicon / nutrimatic / onelook matches?

Yes, this is exactly what I was thinking: a drop-down, defaulting to Lexicon.

— Reply to this email directly, view it on GitHub https://github.com/viresh-ratnakar/exet/issues/32#issuecomment-2148568149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJQ562DZTDSLISYM5ZKBJHTZFZDYRAVCNFSM6AAAAABIYWWNPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYGU3DQMJUHE . You are receiving this because you commented.Message ID: @.***>

viresh-ratnakar commented 3 months ago

Ah, I just realized (I have had the same realization many times :-)), that I can't really access the data returned by nutrimatic, from within Exet (as it's cross-domain data). So, I cannot mix the results into the lexicon results anyway. Moreover, I can't enable click-to-select on those nutrumatic results. At best, I can show them in an iframe (just like I do for Hidden/Alternations).

It probably still makes sense to initiate the action of getting fill choices from other sources from the main Exet tab itself, probably a button called "Web sources" that replaces the "Clear light" button. I'll make a modal iframe appear, in which you can see nutrimatic and onelook results.

mooomooo commented 3 months ago

it's cross-domain data

Hm parsing the response to a GET request works just fine locally (the returned webpage has a list of <span>s), but it looks like nutrimatic doesn't set a CORS header, so browsers balk at the XHR. I assume there's no straightforward workaround? I guess if not then your proposed iframe solution is the best we can hope for, at least unless https://github.com/PuzzleTechHub/nutrimatic/issues/17 gets some traction.

viresh-ratnakar commented 3 months ago

This has been implemented now in Exet v0.92.

https://github.com/viresh-ratnakar/exet/commit/0a7ad245fa8e91ff5b72ca2e5704e26febb88ce5

mooomooo commented 3 months ago

I tried it out; it looks and works great! Thanks for this!