I've been programming with C# and Google Desktop Search (GDS) API for quite a while. Today, when I was browsing the Interop library of GDS (Interop.GoogleDesktopAPI.LIB) in Visual Studio 2008, I found that it's actually possible to obtain the keywords that Google Desktop has identified out of an indexed item. This hasn't been documented by Google GDS API guide yet. (I'm using GDS version 5.1.0707.23222-en-pb.)
Just call the function GetKeywords(int numKeywords, bool includeWeight) of any IGoogleDesktopQueryResultItem3 object and you'll get the keywords as a list of strings. Even better, if you set the input parameter includeWeight to true, then not only will you get the list of keywords, but following each keyword, you'll get the ranking score of that keyword as well.
A sample output for GetKeywords(10, true) is as follows:
papers:10.78 workshop:9.62 layout:9.01 university:8.18
Setting the input parameter 10 asks GDS to return the first 10 keywords, if there are more than 10. Notice that the keywords are always ranked by the ranking score in descending order.
One last thing, it's important to cast a result object to IGoogleDesktopQueryResultItem3, since only this version 3 result object has the GetKeywords() function.
Sunday, August 12, 2007
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(12)
-
►
June
(9)
- WPF: getting a data-bound data template and the it...
- The best tutorial about data binding in WPF
- Day of Silence
- LearnWPF.com
- The correct way to repaint a form or control in c#...
- Postable: convert codes to make them show up prope...
- Obtaining mouse x and y coordinates from a Windows...
- Windows Message Handling, in C#
- Dealing with my clutter
-
►
June
(9)
0 comments:
Post a Comment