OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
http://internship.opengenus.org
GNU General Public License v3.0
13.56k stars 3.68k forks source link

Add search parameters for GitHub search for Cosmos #2528

Open AdiChat opened 6 years ago

AdiChat commented 6 years ago

Objective: Make GitHub search work well for searching for codes within Cosmos

Solution: Add search parameters to codes as a comment Ideally, the search parameter should include the upper classification/ directories and the possible searchable problem statement. This must be done for all existing codes at Cosmos.

This is a simple and yet powerful enhancement can be performed by anyone in parts 👍

For instance, for the code for 2d line intersection in C at location code/computational_geometry/2d_line_intersection, the comment should be:

//  computational geometry | 2D line intersecton | C
//  Part of Cosmos by OpenGenus Foundation

Take a look at the C code: see The second comment is to distinguish codes from OpenGenus and is more of a convention. Consider this search results for 2d line intersection

For a fixed convention, we must place the search parameter comment at the top of the code

Note: new codes should take this into account

marti1125 commented 6 years ago

@AdiChat please review my PR

webbdays commented 2 years ago

I am working on this issue #2528 .

I have made a pull request #6359 . I have used file path for the search parameters. The directory names and file name gives details about the code written in that file. I have written a code to add search parameters at the beginning of the files that are in Python, Ruby, Rust, C, C++, Java, JavaScript programming languages.

My next pull request will be to add these parameters in the README.md file of every folder. This helps to find what that particular folder is for in detail.