Talk:Word wheel: Difference between revisions

From Rosetta Code
Content added Content deleted
m (added a comment about a personal (home-built) dictionary.)
(→‎Algorithms: Memory fine.)
Line 5: Line 5:


: It seems a waste of memory and CPU time to generate all possible conforming strings instead of writing some simple filters that validates the words against the Rosetta Code task and grid (word wheel) constraints. &nbsp; The REXX solution consumes almost all of the CPU time in just reading in the dictionary. &nbsp; The filters that I used for the REXX programming solution eliminate over half of the &nbsp; 25,105 &nbsp; words in the UNIXDICT file, &nbsp; about &nbsp;<sup>1</sup>/<sub>4</sub>&nbsp; of the time used for the filtering was used in the detecting of duplicate words &nbsp; (there are none, however). &nbsp; A very small fraction of that is used to validate that each letter (by count) is represented in the grid. &nbsp; I wonder what the CPU consumption would be if the number of words (entries) in the dictionary were a magnitude larger. &nbsp; My "personal" dictionary that I built has over &nbsp; 915,000 &nbsp; words in it. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:34, 4 July 2020 (UTC)
: It seems a waste of memory and CPU time to generate all possible conforming strings instead of writing some simple filters that validates the words against the Rosetta Code task and grid (word wheel) constraints. &nbsp; The REXX solution consumes almost all of the CPU time in just reading in the dictionary. &nbsp; The filters that I used for the REXX programming solution eliminate over half of the &nbsp; 25,105 &nbsp; words in the UNIXDICT file, &nbsp; about &nbsp;<sup>1</sup>/<sub>4</sub>&nbsp; of the time used for the filtering was used in the detecting of duplicate words &nbsp; (there are none, however). &nbsp; A very small fraction of that is used to validate that each letter (by count) is represented in the grid. &nbsp; I wonder what the CPU consumption would be if the number of words (entries) in the dictionary were a magnitude larger. &nbsp; My "personal" dictionary that I built has over &nbsp; 915,000 &nbsp; words in it. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:34, 4 July 2020 (UTC)

::Hi Gerald, no waste of memory in the Julia case as nested loops are used to generate word candidates one-at-a-time and then quickly checked if they are in the set of dictionary words. Probably hundreds of thousands of lookups which is OK for todays laptops. As for dictionary size, the task ''specifies'' a ''particular'' dictionary to use; going so far outside of that may interest, but is outside the task boundary.
:: Cheers, --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 03:32, 5 July 2020 (UTC)

Revision as of 03:32, 5 July 2020

Algorithms

It seemed logical to me to have the Python entry check each word of the dictionary against the grid constraints. The Julia entry seems to generate all possible conforming strings from the grid characters then checks if they are in the dictionary.
Nice. --Paddy3118 (talk) 15:30, 4 July 2020 (UTC)

It seems a waste of memory and CPU time to generate all possible conforming strings instead of writing some simple filters that validates the words against the Rosetta Code task and grid (word wheel) constraints.   The REXX solution consumes almost all of the CPU time in just reading in the dictionary.   The filters that I used for the REXX programming solution eliminate over half of the   25,105   words in the UNIXDICT file,   about  1/4  of the time used for the filtering was used in the detecting of duplicate words   (there are none, however).   A very small fraction of that is used to validate that each letter (by count) is represented in the grid.   I wonder what the CPU consumption would be if the number of words (entries) in the dictionary were a magnitude larger.   My "personal" dictionary that I built has over   915,000   words in it.     -- Gerard Schildberger (talk) 21:34, 4 July 2020 (UTC)
Hi Gerald, no waste of memory in the Julia case as nested loops are used to generate word candidates one-at-a-time and then quickly checked if they are in the set of dictionary words. Probably hundreds of thousands of lookups which is OK for todays laptops. As for dictionary size, the task specifies a particular dictionary to use; going so far outside of that may interest, but is outside the task boundary.
Cheers, --Paddy3118 (talk) 03:32, 5 July 2020 (UTC)