Ignore local letters in searches

Broken link? Feature request? Anything related to the Spectrum Computing website here.
Post Reply
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Ignore local letters in searches

Post 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...
User avatar
PeterJ
Site Admin
Posts: 6855
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Ignore local letters in searches

Post 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
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Ignore local letters in searches

Post 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.
User avatar
PeterJ
Site Admin
Posts: 6855
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Ignore local letters in searches

Post by PeterJ »

[mention]Ralf[/mention] that is my word of the day!
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Ignore local letters in searches

Post 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.
Last edited by Nomad on Sat Mar 17, 2018 1:43 pm, edited 3 times in total.
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: Ignore local letters in searches

Post 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ŞĈ°§ß :)
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Ignore local letters in searches

Post 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.)
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Ignore local letters in searches

Post 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.
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Ignore local letters in searches

Post 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.
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Ignore local letters in searches

Post 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.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Ignore local letters in searches

Post 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.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Ignore local letters in searches

Post 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.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: Ignore local letters in searches

Post 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.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Ignore local letters in searches

Post 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
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
pavero
Dynamite Dan
Posts: 1570
Joined: Sat Dec 09, 2017 11:49 pm
Location: The Czech Republic
Contact:

Re: Ignore local letters in searches

Post 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)
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Ignore local letters in searches

Post 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.
User avatar
pavero
Dynamite Dan
Posts: 1570
Joined: Sat Dec 09, 2017 11:49 pm
Location: The Czech Republic
Contact:

Re: Ignore local letters in searches

Post 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 ...
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Ignore local letters in searches

Post 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.
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Ignore local letters in searches

Post 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.
AndyC
Dynamite Dan
Posts: 1388
Joined: Mon Nov 13, 2017 5:12 am

Re: Ignore local letters in searches

Post 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)
Post Reply