Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2020-09

how to store long data more than 1 mb of Ascii text

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mgr. Janusz Chmiel

Is it possible to store 1 MB of ASCII clean text to some Pascal source so functions and procedures will have access to it?
The aim of my plea is, that I have complex work in front of Me. I need to store Czech dictionary file which is The dictionary for Pspad text editor. Clients will have to type Czech words and I do not have to depend on their spell checkers. App should determine, if word is missspelled when respondent will type it to editable word. I will also have to use strings related Pascal unit to determine, if predefined three letters first three letters are presented inside The word. Fortunately, every edit box will contain only one word.
The question is, if is it possible to embed long dictionary from Pspad to The source code, because I know, that it is not possible to work from external data file when I will not speak about data stored on some servers. If it would cause memory allocation issues or code crash, I will have to give it up, so big dictionary will not be possible to embed.

Reply by email

Jean SUZINEAU
to Mgr. Janusz Chmiel

I imagine the best would be to use a json file, which is basically a text file storing the data of a javascript object.

At first you'll need to write a program to convert the pspad dictionnary to json. (Check the licence of pspad dictionnary to avoid copyright problems).

Then you can easily put the json file on your server and load it from your pas2js file.

I think you'll need to compute a good index file too, to reduce the search time.

But recognising a word may be tricky.
May be you should dig in the direction of the integrated spellcheckers:

https://www.w3schools.com/tags/att_global_spellcheck.asp

It seems the feature is integrated in HTML/Javascript, may be you can directly get it in pas2js.

Reply by email