menu
Tatoeba
language
Register Log in
language English
menu
Tatoeba

chevron_right Register

chevron_right Log in

Browse

chevron_right Show random sentence

chevron_right Browse by language

chevron_right Browse by list

chevron_right Browse by tag

chevron_right Browse audio

Community

chevron_right Wall

chevron_right List of all members

chevron_right Languages of members

chevron_right Native speakers

search
clear
swap_horiz
search
DostKaplan DostKaplan December 10, 2015 December 10, 2015 at 11:02:14 PM UTC link Permalink

I know question marks are not allowed in a search. It will always return no results. So why not programmatically strip it and other offending characters off the input search string behind the scenes before hitting the database? It is very natural for someone to search for something like "Do you know why?" with the trailing question mark. Just strip it off in the code.

{{vm.hiddenReplies[25038] ? 'expand_more' : 'expand_less'}} hide replies show replies
AlanF_US AlanF_US December 10, 2015 December 10, 2015 at 11:15:46 PM UTC link Permalink

Question marks are allowed in a search. They just have a special function. As our help link says:

:::
The question mark (?) as part of a word is a one-letter wildcard.

The following will find sentences with either "whenever" and "wherever."
whe?ever

The following will find sentences with with 6-letter words that have 2 letters, and then "eve" and then one more letter, such as "clever" "eleven", "peeves", "uneven", ...
??eve?
:::

As you can see, stripping the question mark would prevent people from using this functionality. The same is true for other punctuation marks.

{{vm.hiddenReplies[25039] ? 'expand_more' : 'expand_less'}} hide replies show replies
CK CK December 11, 2015, edited October 30, 2019 December 11, 2015 at 12:08:07 AM UTC, edited October 30, 2019 at 10:38:05 AM UTC link Permalink

[not needed anymore- removed by CK]

{{vm.hiddenReplies[25040] ? 'expand_more' : 'expand_less'}} hide replies show replies
DostKaplan DostKaplan December 11, 2015 December 11, 2015 at 1:18:42 AM UTC link Permalink

In that case, I would do this: If there are results, we're done, else strip the offending "special" characters, perhaps iteratively one at a time, until some results are returned, if possible. An accompanying message might also be displayed such as: "Your search request yields no results, so 'Do you know why" was used instead."

gillux gillux December 12, 2015, edited December 12, 2015 December 12, 2015 at 10:41:23 AM UTC, edited December 12, 2015 at 7:32:28 PM UTC link Permalink

> since people often search for sentences to make sure they don't exist before contributing new ones

I know you’re always doing this, but I don’t think it is true for the majority of people using Tatoeba (including people without an account).

gillux gillux December 12, 2015 December 12, 2015 at 10:38:35 AM UTC link Permalink

DostKaplan has a point though. I think people use interrogation marks in the search function more often intending that character than a wildcard. However it’s not possible to search any punctuation character in the first place (for instance you can’t search for commas). I personally disagree with the previous suggestions (I find them too intrusive). It’s not a easy problem, but maybe we could at least provide a more verbose message than “No results found for: <query>”. Like some hints about common pitfalls that prevent results from being returned: check selected language, wildcards, diacritics…

{{vm.hiddenReplies[25052] ? 'expand_more' : 'expand_less'}} hide replies show replies
AlanF_US AlanF_US December 12, 2015, edited December 12, 2015 December 12, 2015 at 9:48:17 PM UTC, edited December 12, 2015 at 9:57:00 PM UTC link Permalink

Below the message that says "No results found for: XXX", we could display a link to the help for the wiki page about searching:

http://en.wiki.tatoeba.org/arti...w/text-search#

That page already says that punctuation should be omitted when searching.

{{vm.hiddenReplies[25058] ? 'expand_more' : 'expand_less'}} hide replies show replies
CK CK December 12, 2015, edited October 30, 2019 December 12, 2015 at 10:53:14 PM UTC, edited October 30, 2019 at 10:37:34 AM UTC link Permalink

[not needed anymore- removed by CK]

{{vm.hiddenReplies[25059] ? 'expand_more' : 'expand_less'}} hide replies show replies
gleki gleki December 14, 2015 December 14, 2015 at 6:52:03 AM UTC link Permalink

Ehm, no way to escape "?" ?

{{vm.hiddenReplies[25061] ? 'expand_more' : 'expand_less'}} hide replies show replies
CK CK December 14, 2015, edited October 30, 2019 December 14, 2015 at 7:32:40 AM UTC, edited October 30, 2019 at 10:37:25 AM UTC link Permalink

[not needed anymore- removed by CK]

{{vm.hiddenReplies[25062] ? 'expand_more' : 'expand_less'}} hide replies show replies
gleki gleki December 14, 2015 December 14, 2015 at 7:37:19 AM UTC link Permalink

So why not enable escaping?

{{vm.hiddenReplies[25063] ? 'expand_more' : 'expand_less'}} hide replies show replies
gillux gillux December 14, 2015 December 14, 2015 at 12:39:47 PM UTC link Permalink

Because there is no such thing.

tornado tornado December 15, 2015 December 15, 2015 at 12:09:15 AM UTC link Permalink

You can also consider creating a Horus-like script for this purpose: a script that regularly scans the database for questions, exclamations, and dialogues, and then tags them accordingly. Since the advanced search section includes tags, limiting search results to those types of sentences without using punctuation marks would be possible.