Page 1 of 1

Ignore local letters in searches

Posted: Sat Mar 17, 2018 10:11 am
by Ralf
Another one to wishlist ;)

Let's start from the example. There is a game Una Extraña Historia
https://spectrumcomputing.co.uk/index.p ... 6&id=30173

But if you search for "Una Extrana Historia", without this Spanish "ñ", it won't be found.

As you may guess, I even wouldn't know how to type this "ñ" in my Polish Windows ;)

So would it be possible that search engine worked if I type n instead of ñ too?

Preferably It would apply to all such letters, Spanish, German, Polish, Czech...

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 10:32 am
by PeterJ
[mention]Ralf[/mention]

You make a good point. Let me speak to [mention]Einar Saukas[/mention] . We already do a lot of substitutions on the searches to make things easier, and hopefully we can do something here.

I do have a slight worry though as keyboards in other countries I assume have these accents (I think that is the right term), so we don't want to stop their searches working for these users.

We need to all use Esperanto!

Einar or I will update you.

Peter

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 1:03 pm
by Ralf
Thanks!

Yes, you can call these things "accents". But do you know that there is a word "ogonek" in English language? ;)

https://en.wikipedia.org/wiki/Ogonek

It's directly borrowed from Polish language, usually we in Poland borrow a lot of English words and it's one of rare, opposite cases :)

Anyway, the best solution would be if search worked if you type a letter both with and without ogonek.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 1:11 pm
by PeterJ
[mention]Ralf[/mention] that is my word of the day!

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 1:28 pm
by Nomad
Ralf you might like þis video

[media]https://www.youtube.com/watch?v=zUrDUxh ... e=youtu.be[/media]

þe old glyphs were very useful It's a shame we don't have þem any more.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 1:40 pm
by Guesser
Ralf wrote: Sat Mar 17, 2018 10:11 am As you may guess, I even wouldn't know how to type this "ñ" in my Polish Windows ;)
I'm a big fan of compose keys as found on "real operating systems" :lol:

On Windows I use this: https://github.com/samhocevar/wincompose

I can type all sorts of crazy characters ñŷø¼»ΘΩπλäÆfiŞĈ°§ß :)

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 3:40 pm
by Ast A. Moore
Guesser wrote: Sat Mar 17, 2018 1:40 pm I'm a big fan of compose keys as found on "real operating systems" :lol:

On Windows I use this: https://github.com/samhocevar/wincompose

I can type all sorts of crazy characters ñŷø¼»ΘΩπλäÆfiŞĈ°§ß :)
Neat. Odd that Windows requires a third-party tool for this. Is there really no standard method for printing these? Like holding down a modifier and pressing a letter key?

P.S. On macOS, the “Ω” symbol is mapped to the Z key. I’ve always loved it, because Z is the symbol for impedance. :D (R produces ®, which is logical, but altogether unremarkable.)

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 3:57 pm
by Einar Saukas
Ralf wrote: Sat Mar 17, 2018 10:11 am Another one to wishlist ;)

Let's start from the example. There is a game Una Extraña Historia
https://spectrumcomputing.co.uk/index.p ... 6&id=30173

But if you search for "Una Extrana Historia", without this Spanish "ñ", it won't be found.

As you may guess, I even wouldn't know how to type this "ñ" in my Polish Windows ;)

So would it be possible that search engine worked if I type n instead of ñ too?

Preferably It would apply to all such letters, Spanish, German, Polish, Czech...
Good point! This will be in the next ZXDB update.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 4:01 pm
by Einar Saukas
Ast A. Moore wrote: Sat Mar 17, 2018 3:40 pmNeat. Odd that Windows requires a third-party tool for this. Is there really no standard method for printing these? Like holding down a modifier and pressing a letter key?
You can hold ALT while typing the symbol code.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 4:33 pm
by Ralf
Odd that Windows requires a third-party tool for this. Is there really no standard method for printing these? Like holding down a modifier and pressing a letter key?
You can hold ALT while typing the symbol code.
That's true but you should also remember that let's say Alt+N won't always work the same way

For me it gives me now a Polish letter ń (which is a different letter than Spanish ñ ;) )

If you are English you then could never wander there but there is an option in Windows Control Panel to choose your language and keyboard layout as there may be several layouts in one language. I'm currently using Polish "programmer layout" which is different from traditional "typewriter lady layout".

And I can switch my settings to another language but if you don't know the language, you won't know the letters and the shortcuts.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 4:41 pm
by RMartins
Einar Saukas wrote: Sat Mar 17, 2018 4:01 pm
Ast A. Moore wrote: Sat Mar 17, 2018 3:40 pmNeat. Odd that Windows requires a third-party tool for this. Is there really no standard method for printing these? Like holding down a modifier and pressing a letter key?
You can hold ALT while typing the symbol code.
If I remember correctly, it requires a numeric keypad to work.
Laptops, usually do not have one, but they can fake one using the special "FN" key.

So, press ALT + FN and keep pressed, while you input numbers using keys (7,8,9,U,I,O,J,K,L and M).
When you release the ALT key you will get the expected char, if your current font supports it.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 5:46 pm
by Ast A. Moore
RMartins wrote: Sat Mar 17, 2018 4:41 pm
Einar Saukas wrote: Sat Mar 17, 2018 4:01 pm You can hold ALT while typing the symbol code.
If I remember correctly, it requires a numeric keypad to work.
Laptops, usually do not have one, but they can fake one using the special "FN" key.

So, press ALT + FN and keep pressed, while you input numbers using keys (7,8,9,U,I,O,J,K,L and M).
When you release the ALT key you will get the expected char, if your current font supports it.
Yes, that’s how I remember it was on Windows XP. I thought things have progressed since then.

Re: Ignore local letters in searches

Posted: Sat Mar 17, 2018 11:03 pm
by Guesser
The so called "alt-codes" are rather limited anyway. iirc there is a way to enter symbols by typing their full unicode codepoint but that's just bonkers compared to a compose key.

Some things are available on modifiers, with a British key layout alt-gr gives acute vowels áéíóúÁÉÍÓÚ, a Euro symbol € on the 4 key, and a broken pipe ¦ on the backtick key, there may be others.

Re: Ignore local letters in searches

Posted: Sun Mar 18, 2018 12:09 am
by Ast A. Moore
Here’s what you get on macOS. The bottom two images show the symbols you get when you hold down the Option key and the Option and Shift keys, respectively. (The characters highlighted in orange are combination characters—when followed by a suitable letter, they produce a combination: î, ñ, ü, etc.)

Image

Re: Ignore local letters in searches

Posted: Fri Mar 23, 2018 7:09 pm
by pavero
Here is a PHP function which removes all Czech and Slovak chars from the $string.

function NoCzech($string)
{
$trans = array("á"=>"a", "é"=>"e", "í"=>"i", "ó"=>"o", "ů"=>"u", "ú"=>"u", "ý"=>"y", "ř"=>"r",
"ě"=>"e", "š"=>"s", "č"=>"c", "ž"=>"z", "ť"=>"t", "ď"=>"d", "ň"=>"n", "ľ"=>"l",
"Á"=>"A", "É"=>"E", "Í"=>"I", "Ó"=>"O", "Ů"=>"U", "Ú"=>"U", "Ý"=>"Y", "Ř"=>"r",
"Ě"=>"E", "Š"=>"S", "Č"=>"C", "Ž"=>"Z", "Ť"=>"T", "Ď"=>"D", "Ň"=>"N", "Ľ"=>"L");

return strtr($string, $trans);
}

(utf-8 coding used)

Re: Ignore local letters in searches

Posted: Fri Mar 23, 2018 7:27 pm
by Einar Saukas
Thanks! But we would need to use a much longer function for all idioms, both in the search tables and the websites.

Instead, I decided to change the database collation of the search columns. Everything seems to be working now. Try searching for "Extrana" or "Extraña", for instance.

Re: Ignore local letters in searches

Posted: Fri Mar 23, 2018 7:47 pm
by pavero
Einar Saukas wrote: Fri Mar 23, 2018 7:27 pm Thanks! But we would need to use a much longer function for all idioms, both in the search tables and the websites.

Instead, I decided to change the database collation of the search columns. Everything seems to be working now. Try searching for "Extrana" or "Extraña", for instance.
yep, it looks as much better solution ...

Re: Ignore local letters in searches

Posted: Fri Mar 23, 2018 8:51 pm
by Ralf
Great!

Einar, would you be interested in names of Polish programs, people etc. with original, local Polish letters?
Currently 99% of the names come from WOS which didn't support local letters so they are missing.

Re: Ignore local letters in searches

Posted: Fri Mar 23, 2018 8:57 pm
by Einar Saukas
Ralf wrote: Fri Mar 23, 2018 8:51 pm Great!

Einar, would you be interested in names of Polish programs, people etc. with original, local Polish letters?
Currently 99% of the names come from WOS which didn't support local letters so they are missing.
Sure!

Now that all searches work properly regardless of accents, there's no reason anymore to remove them.

Re: Ignore local letters in searches

Posted: Sat Mar 24, 2018 10:10 am
by AndyC
Guesser wrote: Sat Mar 17, 2018 11:03 pm The so called "alt-codes" are rather limited anyway. iirc there is a way to enter symbols by typing their full unicode codepoint but that's just bonkers compared to a compose key.
In a lot of Windows apps, like Wordpad, you can just type the unicode codepoint then hit Alt-X to convert it into the appropriate character but it's not exactly a very useful approach unless you have some kind of awesome memory (or a lookup table, but then you might as well just copy+paste them)