Post Reply 
How much memory may a HPPL program use on a G2?
09-18-2023, 07:14 PM (This post was last modified: 09-19-2023 03:50 AM by komame.)
Post: #68
RE: How much memory may a HPPL program use on a G2?
Hello Tyann,

(09-18-2023 06:51 PM)Tyann Wrote:  Good evening Komane,
I've finally found some time to look at your code.
I've only looked at the conversion for now.
I didn't think of 'REPLACE' for a second Sad(
I found a few similarities with mine, notably putting accented letters in one list and their equivalent in another.
I then made my function faster by using a string instead and by using the str(i) notation which allows you to extract a character from a string but also to replace one.
I wondered if I could adapt this to your code, and the idea was to do :

Code:

accent:="àéèç......";
latin :="aec...."
for i from 1 to dim(str)
 str:=replace(str,accent(i),latin(i);
end;
Unfortunately, 'replace' doesn't seem to accept this notation.

Try this:
Code:
str:=replace(str,CHAR(accent(d)),CHAR(latin(d)));
But you need to iterate from 1 to the number of accent characters you have to convert, not the length of the text you're converting. So, instead of dim(str) in your REPLACE usage example, it should be dim(accent) or dim(latin) instead.

(09-18-2023 06:51 PM)Tyann Wrote:  On my side, my idea of optimization didn't give anything obvious, but my new organization allowed me to optimize the search when the first letter is known, the search is done in <2 s.
Did you get a result in less than 2 seconds for the 9-letter word with the pattern "A????????" or was it a different first letter? How many words did you get in the result?

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How much memory may a HPPL program use on a G2? - komame - 09-18-2023 07:14 PM



User(s) browsing this thread: 8 Guest(s)