unix_dict
The file builtins/unix_dict.e (an autoinclude) implements unix_dict() which returns a list of words in a way
that is compatible between desktop/Phix and pwa/p2js.
While desktop/Phix reads demo/unixdict.txt, obviously a browser applies all sorts of security and CORS restrictions which effectively prevent the reading of local disk files, and we don’t particularly want to set up a server to honor some GET/POST request, so instead pwa/builtins/unix_dict.js simply contains a machine-generated constant of all 25,107 words, ~284K.
Note that file gets rebuilt when pwa/p2js.exw is run should it not exist or when builtins/unix_dict.e has been modified1, but not when demo/unixdict.txt is modified, and not incorporating any changes made to builtins/unix_dict.e. See pwa/p2js.exw routine rebuild_builtins_and_run_tests() for more details and the equivalent JavaScript code that may need to be kept in line (manually) with desktop/Phix.
1Only because that’s how all the other files are handled, and adding an exclusion just because this one is fairly pointless would be, erm, fairly pointless.
While desktop/Phix reads demo/unixdict.txt, obviously a browser applies all sorts of security and CORS restrictions which effectively prevent the reading of local disk files, and we don’t particularly want to set up a server to honor some GET/POST request, so instead pwa/builtins/unix_dict.js simply contains a machine-generated constant of all 25,107 words, ~284K.
Note that file gets rebuilt when pwa/p2js.exw is run should it not exist or when builtins/unix_dict.e has been modified1, but not when demo/unixdict.txt is modified, and not incorporating any changes made to builtins/unix_dict.e. See pwa/p2js.exw routine rebuild_builtins_and_run_tests() for more details and the equivalent JavaScript code that may need to be kept in line (manually) with desktop/Phix.
1Only because that’s how all the other files are handled, and adding an exclusion just because this one is fairly pointless would be, erm, fairly pointless.
Example:
printf(1,"unix_dict() returns %,d words\n",length(unix_dict())) -- (currently 25,107)
|
|
|