Quick search for Chinese characters

Here you can propose new features, make suggestions etc.

Moderators: sheep, Hacker, Stefan2, white

User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Quick search for Chinese characters

Post by *Shanny »

2ghisler(Author)

I'm the author of QuickSearchPro, an enhanced quick search tool to support first letter of PinYin search in Chinese.
Here http://www.ghisler.ch/board/viewtopic.php?t=22112&postdays=0&postorder=asc&start=15
I leart that you'll develop "separate phonetic searches for Chinese" soon, I think the related source code of QuickSearchPro maybe useful for this feature, it supports multi-pronunciation PinYin search, and I beleive its PinYin search algorithm is faster than almost all of others.
If you need, I'd like to provide the source code to you unconditionally, or if you have no time, I think I can help to implement the wcmd_chn.dll if you tell me the interface.

Btw: I'm also the auther of F4Menu, will you consider to integrate such F4Menu feature in TC? If yes, I can provide source code as well. :)
TCEE, TCPP, F4Menu -- Shanny
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks very much for your offer!

I have already written such a dll for beta 4, and it is very fast. :)

The source will be public, so if your method is faster you can write a faster dll.

Regarding F4Menu: Unfortunately I don't currently have the time to write a similar function, or integrate your solution. The main problem is that it would need additional translations.
Author of Total Commander
http://www.ghisler.com
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

Great! looking forward to beta4, when will it be released?
TCEE, TCPP, F4Menu -- Shanny
User avatar
WatchUer
Senior Member
Senior Member
Posts: 242
Joined: 2003-02-22, 10:46 UTC
Location: China

Post by *WatchUer »

I guess tomorrow. :wink:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Probably yes, if all goes well.
Author of Total Commander
http://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, here is the PinYin search (first character only) for TC 7.5 beta 4 now:

Auto-installing dll:
http://ghisler.fileburst.com/chinese/PinYinQuickSearch.zip

Source:
http://ghisler.fileburst.com/chinese/PinYinQuickSearch_src.zip

IMPORTANT NOTE: You need to close and restart Total Commander after installing the search tool to use it.

I'm using a binary table created from the "Unicode Pinyin table" available here:
http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/ftp/CJKtable/Uni2Pinyin.Z

To rebuild the table tcmatch.tbl, you need to delete tcmatch.tbl, then unpack Uni2Pinyin.Z (with Z plugin) to TC dir, and rename the file to tcmatch.txt.

Then restart TC and search for some Chinese character. The addon will then automatically rebuild the table.

I have no idea how well it works, it worked OK with all the Chinese characters I tried. The tcmatch.tbl supports up to 3 variations per character. The few characters with more than 3 are handled internally by tcmatch.dll.

The dll interface is very simple:
BOOL __stdcall MatchFileW(WCHAR* Filter,WCHAR* FileName);
Author of Total Commander
http://www.ghisler.com
User avatar
zhv
Junior Member
Junior Member
Posts: 76
Joined: 2006-03-11, 14:54 UTC

Post by *zhv »

That's great! Thanks a lot, Mr Ghisler, and Shanny!

It workd fine so far here.

But I suggest the search box could automatically disapear after a short period(which can be configured by the user), just like the QuickSearchPro way!
User avatar
Samuel
Power Member
Power Member
Posts: 1877
Joined: 2003-08-29, 15:44 UTC
Location: Brandenburg, Germany
Contact:

Post by *Samuel »

I wonder if this new search could also be used for something like excluding punctuations:

Code: Select all

Search for: one two

Find Files: one, two.txt one - two.txt
Or for a search like google:

Code: Select all

Search for: one two

Find Files:
one tree two.txt
two tree.one
That would be gr8!
softy
Junior Member
Junior Member
Posts: 6
Joined: 2005-01-12, 11:47 UTC
Location: China
Contact:

Post by *softy »

旺德福
wonderful
My English is very poor ,I hope you can understand……
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Samuel
The search dll is for quick search and quick filter only - but you can now write your own search dll for whatever you need!

2zhv
2softy
Thanks for trying it!
But I suggest the search box could automatically disapear after a short period
Hmm, interesting idea, I will consider it as an option. Currently you need to press ESC or start some operation with the file, like ENTER, F3, F4, F5, F6, F8/Del etc.
Author of Total Commander
http://www.ghisler.com
User avatar
Csharp
Junior Member
Junior Member
Posts: 14
Joined: 2003-12-22, 20:34 UTC

about tcmatch.dll with pinying

Post by *Csharp »

The tcmatch.tbl supports up to 3 variations per character. The few characters with more than 3 are handled internally by tcmatch.dll.
...first variation work well.. but the second and third can't work.

if you can test, try this chinese

4E80 gui1 jun1 qiu1

the chinese is 亀
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

2ghisler(Author)
Great thanks!
All Chinese users would thank you for this great feature:)

However, you made a very small mistake, hence it cannot work with all multi-pronunciation chars.
I corrected it and now it works fine

fixed code:
http://www.shanny.com.cn/download/PinYinQuickSearch_src_fixed_by_shanny.zip

Auto-installing dll:
http://www.shanny.com.cn/download/PinYinQuickSearch_fixed_by_shanny.zip
TCEE, TCPP, F4Menu -- Shanny
User avatar
Samuel
Power Member
Power Member
Posts: 1877
Joined: 2003-08-29, 15:44 UTC
Location: Brandenburg, Germany
Contact:

Post by *Samuel »

Edit: There is probably a bug in it. The funktion "BOOL __stdcall MatchFileW(WCHAR* Filter,WCHAR* FileName);" is only called for all files that doesnt already fit to the filter. For example:

Code: Select all

Filelist:
a.txt
b.txt
c.txt <- cursor
d.txt
e.txt

Filter: "a"

MatchFileW is called with:
c.txt <- because of cursor position
b.txt
c.txt
d.txt
e.txt
Strange: For the file "a.txt" MatchFileW is not called (with filter "a").
(I think its design, but would be a better and more general to call for all files.)

Strange: Why is it called with the file under cursor two times?
Also called for ".." if cursor is on that item although it could not be filtered.

Created a Google-like Quicksearch. Can be downloaded here.

Bug: There are Problems using an Auto-installing dll:
The file could not be overwritten, because TC uses it. Could it be unloaded?
Last edited by Samuel on 2009-05-30, 01:03 UTC, edited 1 time in total.
cheming
Member
Member
Posts: 150
Joined: 2004-05-07, 14:38 UTC
Location: China

Post by *cheming »

2ghisler:

I have tried that feature and it works well for me.

Thank you very very very very much!
User avatar
fenix_productions
Power Member
Power Member
Posts: 1956
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

2ghisler(Author)
Are there real chances to extend MatchFileW method a little bit or add another one?

Currently it gives filter and file name but it would be also great to get visible columns content somehow too.

That way it would be very easy to create something to fit my idea from the past.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
Post Reply