World: r3wp
[Core] Discuss core issues
older newer | first last |
Henrik 3-Aug-2008 [10819] | I guess this is where the fabled find/deep would come in. |
ICarii 3-Aug-2008 [10820x2] | lol deep in a 1 level block :P |
just checked R3.. doesnt work there either :( | |
Henrik 3-Aug-2008 [10822] | I know :-) I guess you have to wonder what result you want back, because it has to search each string in the block. what you are looking for is a find on each string in the block and what if that is not found in the beginning? Does it return two indexes, one for the string and one for the block? That's where /deep comes in. |
ICarii 3-Aug-2008 [10823x2] | first find - returns succesful index |
as normal find works | |
Henrik 3-Aug-2008 [10825x2] | yeah, but find doesn't know that |
perhaps it's simpler to parse the string | |
ICarii 3-Aug-2008 [10827x2] | too slow with 50,000+ words and pattern matching? |
ill probably just use C# and use regex :) | |
Henrik 3-Aug-2008 [10829x2] | deep-find: func [blk str] [repeat i length? blk [all [find/any blk/:i str break/return at blk i]]] |
could probably be sped up with while or until | |
ICarii 3-Aug-2008 [10831x2] | or by length matching wildcard pattern |
because once i use the full 300,000+ word dictionary its gonna need to be fast :) | |
Henrik 3-Aug-2008 [10833] | it helps if you are searching a hash |
ICarii 3-Aug-2008 [10834] | wildcard searching a hash is rather messy tho isnt it? |
Henrik 3-Aug-2008 [10835x2] | I've not tried it, but find should be much faster in hashes. |
are you always searching from the beginning of the string? | |
ICarii 3-Aug-2008 [10837x2] | no |
eg "?ex??w*a" | |
Henrik 3-Aug-2008 [10839] | hmm |
ICarii 3-Aug-2008 [10840x2] | think crossword matching |
but without defined lengths | |
Henrik 3-Aug-2008 [10842] | then it wouldn't help to divide the dictionary in sections by first letter |
ICarii 3-Aug-2008 [10843x3] | only safe exclusions would be minimum desired length |
eg if someone does "*was" you can remove everything 2 letters or less | |
but that seems to be the limit of preprocessing the list | |
Henrik 3-Aug-2008 [10846x3] | I use similar code in LIST-VIEW and it searches about 30000 words in 0.1-0.2 seconds. It does no t use expression matching, though. |
and it also gets all results | |
rather than just the first one | |
ICarii 3-Aug-2008 [10849] | ive got some old code i did a few years ago in C# that uses regex to do it but I was just curious if rebol could do it in a timely manner |
Henrik 3-Aug-2008 [10850] | parse should probably not be ruled out. it's very fast. |
ICarii 3-Aug-2008 [10851x2] | im testing parse at the moment - ill test it on R2/R3 and see how it rates |
this by ladislav was interesting http://www.compkarori.com/vanilla/display/PARSE-Versus-Regexs | |
Anton 21-Aug-2008 [10853x2] | http://anton.wildit.net.au/rebol/library/string-search-functions.r http://anton.wildit.net.au/rebol/library/demo-string-search-functions.r |
(They don't do wildcard searching, though could be modified I suppose...) | |
Graham 2-Sep-2008 [10855x2] | Is there any windows setting, or anything else, which results in 'now not providing the timezone? |
I've got an encapped application which is failing, and it can only be failing if there is no timezone in the 'now data. | |
Oldes 2-Sep-2008 [10857x3] | yes... jeruzalem time-zone:) |
very interesting | |
it should be +2:00 but I have no timezone in rebol | |
Graham 2-Sep-2008 [10860] | why? |
Oldes 2-Sep-2008 [10861] | also you have to restart rebol to get changed timezone setting updated |
Graham 2-Sep-2008 [10862] | >> now == 2-Sep-2008/22:23:12+12:00 |
Oldes 2-Sep-2008 [10863] | ech.. no... now it's correct |
Graham 2-Sep-2008 [10864] | what happens for you? |
Oldes 2-Sep-2008 [10865x2] | so I'm not sure |
I'm changing timezones in settings and check 'now in Rebol... I got it without timezone once | |
Graham 2-Sep-2008 [10867] | oh .. bug then. |
Oldes 2-Sep-2008 [10868] | >> now == 2-Sep-2008/12:21:27 |
older newer | first last |