Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Make true and false global!

We all know true and false, but what do speakers around the globe say?

+----------------------+------------+------------+
| Language | True | False |
+----------------------+------------+------------+
| Arabic | sahih | zaif |
| Armenian | irakan | kelc |
| Assamese | asol | misa |
| Breton | gwir | gaou |
| Bulgarian | veren | neveren |
| Catalan | veritable | fals |
| Cornish | gwir | gaw |
| Czech | pravdivy | nepravdivy |
| Danish | sand | falsk |
| Dutch | waar | onwaar |
| English | true | false |
| Esperanto | vera | malvera |
| Finnish | tosi | epatosi |
| French | vrai | faux |
| Galician, Portuguese | verdadeiro | falso |
| Georgian | namdvili | cru |
| German | wahr | falsch |
| Greek | alithis | psevdis |
| Hebrew | hiyuvi | shikri |
| Hindi, Urdu | thik | jhutha |
| Hungarian | igaz | hamis |
| Icelandic | sannur | rangur |
| Indonesian, Malay | benar | salah |
| Irish | fior | breagach |
| Italian | vero | falso |
| Japanese | shin | nise |
| Korean | cham | geojit |
| Latin | verus | falsus |
| Latvian | patiess | nepareizs |
| Mandarin Chinese | zhen | jia |
| Maori | pono | pate |
| Persian | dorost | galat |
| Polish | prawdziwy | falszywy |
| Romanian | adevarat | fals |
| Russian | vernyj | falsivyj |
| Sardinian | beru | falsu |
| Scottish Gaelic | fior | breugach |
| Spanish | verdadero | falso |
| Swedish | sann | falskt |
| Sylheti | hasa | misa |
| Turkish | dogru | yanlis |
| Volapuk | veratik | dobik |
| Welsh | gwir | anwir |
+----------------------+------------+------------+

All words ASCIIfied from Wiktionary: true, false. Preference given to first entry under 'A state in Boolean logic that indicates an affirmative or positive result'/'state in Boolean logic that indicates a negative result', then first entry under 'concurring with a given set of facts'/'untrue, not factual, wrong'. I apologise if your favourite language is not included or the word choice for your language is not optimal - go edit Wiktionary!

Write a program or function that takes one word from the table above as input and outputs a consistent truthy value if the word means 'true' and a consistent falsy value otherwise. Your code must produce the correct output for all 79 possible inputs. Shortest code (in bytes) in each language wins.

Sorted list of unique words meaning 'true':

adevarat,alithis,asol,benar,beru,cham,dogru,dorost,fior,gwir,hasa,hiyuvi,igaz,irakan,namdvili,patiess,pono,pravdivy,prawdziwy,sahih,sand,sann,sannur,shin,thik,tosi,true,vera,veratik,verdadeiro,verdadero,veren,veritable,vernyj,vero,verus,vrai,waar,wahr,zhen

Sorted list of unique words meaning 'false':

anwir,breagach,breugach,cru,dobik,epatosi,fals,falsch,false,falsivyj,falsk,falskt,falso,falsu,falsus,falszywy,faux,galat,gaou,gaw,geojit,hamis,jhutha,jia,kelc,malvera,misa,nepareizs,nepravdivy,neveren,nise,onwaar,pate,psevdis,rangur,salah,shikri,yanlis,zaif

Answer*

Draft saved
Draft discarded
Cancel
5
  • 3
    \$\begingroup\$ Would it be shorter to match falsy inputs instead? (they seem to have a very common substring fa) (I'm not sure whether you can output inverted, probably not) \$\endgroup\$ Commented May 31, 2020 at 6:38
  • \$\begingroup\$ @mypronounismonicareinstate Yes it should. Porting my regex to Retina would be 49 bytes + whatever is required to invert the result. \$\endgroup\$ Commented May 31, 2020 at 9:23
  • \$\begingroup\$ If so, this works for 54 bytes (I won't be surprised if there's a shorter way to invert the regex, though) (assuming Arnauld is okay with their regex being stolen) \$\endgroup\$ Commented May 31, 2020 at 9:26
  • \$\begingroup\$ @mypronounismonicareinstate Sure. Now 51 bytes, btw. \$\endgroup\$ Commented May 31, 2020 at 10:20
  • \$\begingroup\$ @Arnauld Thanks, but I feel that updating my answer now would make it too similar to the other answers that use regex (currently yours and the Ruby answer) \$\endgroup\$ Commented May 31, 2020 at 14:32

AltStyle によって変換されたページ (->オリジナル) /