Dictionary: Flexible pinyin search for multi-word strings

Shun

状元
Hello Mike,

as of right now, when entering multi-word pinyin in Dictionary search, there needs to be a dictionary entry which matches that pinyin string. If a user puts whitespace in between two or more pinyin words, would it not be useful if Pleco also searched for those words individually and listed the 3-5 most common word/expression matches for each? It already does this for Hanzi strings, of course, where the user input is more specific.

Combinations of Hanzi and pinyin are also currently not possible for multiple words in the 4.0 beta.

When watching Chinese TV, for example, I would be quite happy if Pleco helped me with combining longer expressions which were clearly understood phonetically.

Have you already considered such an addition to the core Dictionary functionality? Thanks!

Shun
 

mikelove

皇帝
Staff member
Honestly with pinyin I think this would be too messy - too many homonyms, particularly since any Chinese phrase of any length is going to have some single characters thrown in (and since people hate entering tones after their pinyin). There would be way too many cases where the character you were looking for did not appear among the top 5. Also, the spaces themselves would be somewhat unreliable, since you don't really know from listening to spoken Chinese where they should go.

If we wanted to support something like this I think we'd need to apply some intelligence to it, either the tiny local AI model we're probably going to have to roll out at some point or some other system to come up with a few linguistically plausible phrases that match the blob of pinyin you entered; just treating it like we do character searches would not deliver a satisfactory experience.

The good news is that smarter people than me have already developed systems like that for use in Chinese IMEs, so if you experiment with a couple of those I suspect you'll find one that does a decent job of turning the expression you heard into characters to search in Pleco.
 

Shun

状元
Thanks for the thoughtful answer. Such a feature—with or without AI—would certainly need to be used with some caution and be an off-by-default option (which understandably you'd like to have fewer of). But the way it works today, I think, breaks the flow of using a dictionary with pinyin even a little bit more, since you can enter only one pinyin at a time, and you have to keep in your short-term memory what other words followed it. At present, you're almost required to have a piece of note paper next to Pleco and then feed the words to the dictionaries one at a time afterwards. That way, it also isn't possible to see multiple definitions close together on the screen when using pinyin. That will surely improve by much with the desktop version with windowing, but for the smartphone/tablet version, and for the efficiency-minded, simultaneous display would probably outweigh the disadvantages you have mentioned. The better your Chinese 听力 gets, and the bigger your 词汇 already is, the more useful such a feature would probably be, because then you would get the word boundaries and even the tones right almost all of the time.

What may be another great option for me would be commas between pinyin words in the search bar. Then Pleco could simply spit out definitions for all of those at once, and it could allow you to switch between them using tabs or somesuch. Have you perhaps already weighed going in that kind of direction?

I will definitely have another look at the newest smart IMEs. And thanks for the like, @jurgen85! Let's share with one another when we have found a promising new IME. (preferably for iOS, but Android would work, too)

Cheers,

Shun
 

mikelove

皇帝
Staff member
I can see the basic logic of 'let me aggregate a bunch of pinyin searches in the search box', I just think it has to be a more explicit action - here are some pinyin words, look up all of them - rather than a fallback like it is with breakdown searches, because unlike with those, the odds of it actually producing a coherent, accurate string of translations is much lower. So maybe something like your comma suggestion, but probably with a more obscure character than a comma since people use those a lot in pinyin transcriptions of Chengyu.

Another issue I have with this is that you can't actually fit much pinyin in the search bar right now, and it's awkward/annoying to have a search text that's wider than the screen. An idea I've been thinking about for a while now is some sort of separate "sentence composer" search screen designed for bulk text input - input field that expands to multiple lines, easy controls for navigating around it, easy editing of word breaks / selection of which specific reading you want for a particular character, ability to save/retrieve your previous sentence breakdowns, that kind of thing; could maybe also hook this into the regular reader so you could go through a document sentence by sentence, with text immediately before/after visible but grayed out and this breakdown UI taking up most of the screen. But this would take a LOT of work to design / refine to a satisfying workflow so probably more of a 5.0 thing at this point.

Another idea would be that when you enter a string of pinyin that doesn't have a match, we would show you every result that matched the start of it - going from longest to shortest - and you could select one of those, at which point we would 'lock in' that result, replace that chunk of the pinyin in the search with those characters, and then show you a prompt for the next thing. Basically the same idea as a pinyin IME but with definitions.
 

Shun

状元
Great ideas, yes, I also thought along the lines of having a little smart editor. Before that happens, perhaps one could make the input box growable (first one line high, then dynamically growing to two or three lines) and add something like a "|" button to the keyboard which could separate multiple pinyin searches.

I also think the idea in the last paragraph would be great. One could tap on the right Hanzi from a choice of Hanzi, like you would in an IME.

Thanks a lot!

Shun
 

mikelove

皇帝
Staff member
Thinking more on the comma option, one quick version of this doable even in 4.0 - and without an off-by-default option - would be that if a search query starts with a /, we treat each subsequent / as the start of a new search and aggregate all of those. So "/nin2/叫/shen么/ㄇㄧㄥㄗ" would get you 您+叫+什么+名字. Would that make sense?
 

mikelove

皇帝
Staff member
Needs some tweaking, but:
1768509567515.png
 

mikelove

皇帝
Staff member
Also realized that I could do a version of my pinyin-to-characters idea through the context menu, so that's in too, with a new "replace ..." command if the characters for the selected word don't match the current text in the search box for that section:

1768512286992.png
1768512298561.png
 

Shun

状元
Amazing, thank you so much! That will be great!

For me, it wouldn't be a problem if Pleco displayed more than one/two matches for each pinyin entered, the main thing would be that they're all in the same list. But I'll try it out first with the next beta.

Shun
 

mikelove

皇帝
Staff member
I found it helpful in testing myself, but will wait to see other reactions - if it’s really popular we could even add buttons to the list cells to make it easier (though then we also have to add undo support for stray taps).
 

Shun

状元
Hello Mike,

Many thanks for the quick turnaround. Beta 37 is working great for me so far. After having used the multi-search input feature for a few minutes, I have two related, smaller usability suggestions.

If I enter a pinyin search that yields a lot of results, followed by others, it may be great to have two vertical arrow buttons on the right side of the screen to skip efficiently between different searches. Perhaps even nicer, one could temporarily display a list of all the search result input strings while the user tap-holds the area on the right, so the user can skip ahead to a particular search while the finger is in contact with the screen, and Pleco will jump there in real time, very similar to how the vertical dictionary slider works in a definition screen. Like the dictionary slider, the search switcher could be rendered in the highlight color in a bold font. It could have a somewhat similar feel to the Dock in macOS.

Similarly, it may also be great to be able to collapse a particular search result by tapping on its small title bar, and expand it again by tapping the collapsed title bar. This would work like collapsing dictionaries in a definition screen. The collapsed title bar would just have to grow a little bit thicker for tappability.

I haven't used the new Replace command that much so far, because once I have added a new card to flashcards, my job was already done, and I didn't absolutely need to see the right Hanzi in the search results. But other users may of course find different uses for the feature.

Do you think one or both of the above UI suggestions might fit into Pleco's general UI language?

I wish everyone a good night :) !

Shun
 

mikelove

皇帝
Staff member
Actually, the 'replace' command is intended to deal with both of the scenarios you mention, since it lets you quickly turn the pinyin into the correct characters and thereby hopefully make the section equivalent to what would you get if you had entered characters from the get go. This is why I was considering whether we should make it easier to access, e.g. by showing replace buttons directly next to search results.

Both of the options you mention require adding more interface clutter - and in the case of the collapsible toolbars would also mean like 1/3 to 1/2 of a result's worth of lost space - so while they're certainly possible I'd like to try to find a more minimal approach first. (showing a list of results on the right is dicey because some of them could be quite wide, in fact I'm not even sure if we could do it without writing some elaborate custom view)
 

Shun

状元
The Replace command is surely useful, but in my testing, it didn't help in making the listings shorter, as Pleco will also display compound words which start with the chosen character(s), which is great, but probably requires more effective navigation than simply scrolling up or down and visually looking for the start of the next definition.

So perhaps a custom menu-like tap-hold UI control similar to the dict slider which allows efficient browsing/switching between different search results would be best, hovering above everything else and only displaying the first 10 chars of each search string. Anything which contributes to fast and easy navigation between different search results. But I have no idea of how hard or easy such a control might be to program inside Pleco. Maybe there are slim open source libraries for it, but I do not know. I will gladly contribute more ideas later.

Then again, all of this effort to improve something that is hidden behind a special syntax with slashes, wouldn't be good design, either. Perhaps if people love this multi-input search, a larger overhaul like the one you've already described would be necessary, which would better be put off until later, so this is probably best left in as a quick hack, no more or less.

Thanks a lot already,

Shun
 
Last edited:
Top