duckduckgo / zeroclickinfo-fathead

DuckDuckGo Instant Answers based on keyword data files
https://duckduckhack.com/
Other
318 stars 365 forks source link

Python: add coverage for more classes #526

Closed MariagraziaAlastra closed 7 years ago

MariagraziaAlastra commented 7 years ago

Description

Add coverage for more classes.

https://duckduckgo.com/?q=python+subprocess&atb=v23&ia=meanings should show a summary of the class and an infobox link to this category page

Get Started

Resources


Instant Answer Page: https://duck.co/ia/view/python

Hestben commented 7 years ago

I am considering taking on this issue, but I have a question regarding

should show a summary of the class and an infobox link to this category page

Is it meant, rather than the current displaying of "Meanings", there should be an info box with an overview of the class, and then a link to the python documentation for this class? The current view of the example python_subprocess I guess the question is to @jdorweiler who brought up the issue in the thread https://forum.duckduckhack.com/t/python-docs-fathead/176/23

jdorweiler commented 7 years ago

@Hestben I was thinking of something like the ruby IA where it shows a short summary about the class and a link in the infobox to the class methods.

https://duckduckgo.com/?q=ruby+array&t=canonical&atb=v23&ia=about&iax=1

Hestben commented 7 years ago

@jdorweiler So, do you suggest it should have categories? So, a module, like "subprocess" should be a category? Then, the view would be similar to using "Disambiguation" entry type, like the example in the docs: https://duckduckgo.com/180/c/Css_pseudo_elements?ia=list

jdorweiler commented 7 years ago

Here's an example of what I was thinking of

selection_043

Hestben commented 7 years ago

@jdorweiler Yes, I can see that would be a nice way to display it. But the links under "Related Topics" seems to be categories, according to the docs. And we would want to map from a python class to its functions, but categories would map from the python functions to the python class.

jdorweiler commented 7 years ago

The links under related topics could go to the actual abstract pages. For example subprocess.run would link here https://duckduckgo.com/35/subprocess.run?iax=1&ia=about

Hestben commented 7 years ago

@jdorweiler Yes, I can see that. The problem I am working with now is where to put the actual links in the fathead output fields. Which field should be used? How are the links supposed to look like? From my limited understanding of how categories work, it looks to me that they map the other way around. I have yet not found an example where the field "related topics" is displayed, and not "categories".

jdorweiler commented 7 years ago

@Hestben you're right. For some reason I though we could do this. I just saw this comment on the same idea https://github.com/duckduckgo/zeroclickinfo-fathead/issues/500#issuecomment-261112053

Hestben commented 7 years ago

@jdorweiler So, how do we continue this? Should we await a change in the InfoBox to be able to handle this information, or is there some other way we could display this?

Hestben commented 7 years ago

I just got a hint from @tagawa of this query: https://duckduckgo.com/?q=python+print&ia=about There, the output looks like we would want it to be. Looking in output.txt, I see, that the output type for the query "python print" is "A", and has "print" as category. The related topic displayed ("python2 print") is using "print" as category. Thus, we could iterate through the things we want to display in "Related Topics" and add a category to it. Is this an acceptable solution, or is it possible we would add a lot of categories, that will interfere with other searches?

jdorweiler commented 7 years ago

@Hestben I'm going to see what changes need to be made to allow the infobox to work with non-category pages.