Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to detect symbols like +, /, etc. in the queries #485

Open
SudhakarKuma opened this issue May 26, 2023 · 7 comments
Open

Add method to detect symbols like +, /, etc. in the queries #485

SudhakarKuma opened this issue May 26, 2023 · 7 comments

Comments

@SudhakarKuma
Copy link

Description

Add some method to detect symbols in the query. Let us say, we want to know how to use + sign to concatenate two strings. To know this, one can pass queries, like

  • howdoi use + concat strings
  • howdoi use plus concat strings
  • etc.

At present, the outputs for these two are as shown below:

> howdoi use + concat strings
+
> howdoi use plus concat strings
public class Concat {
    String cat(String a, String b) {
        a += b;
        return a;
    }
}

Additional Comments (if any)

Similarly, the results vary significantly for queries like howdoi a divide b, howdoi a / b, etc.

Have you read the Contributing Guidelines on Pull Requests on mkdocs?

Yes

@SudhakarKuma
Copy link
Author

I can take this up and submit a PR, if the developers feel that this issue has some merit. @gleitz

@gleitz
Copy link
Owner

gleitz commented May 30, 2023

This is interesting. It looks like the search engine gives different results.

~ » howdoi use + concat strings --link
https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings
~ » howdoi use plus concat strings --link
https://stackoverflow.com/questions/47605/string-concatenation-concat-vs-operator

How are you thinking of solving the issue?

@SudhakarKuma
Copy link
Author

Hi @gleitz , Thank you for your response! From the results, it seems that use plus concat strings fetches better results as compared to use + concat strings. So, I was thinking whether we should replace the symbols by their suitable meanings (in words) at the back end and then, we run the query.

I would be happy to know your take on this.

@gleitz
Copy link
Owner

gleitz commented May 30, 2023

This would be the first time we're rewriting queries. I don't know if the impact will be worth the risk of "tampering" with the request.

@SudhakarKuma
Copy link
Author

Oh, I see! Any other suggestions by which we can detect symbols in the queries?

@gleitz
Copy link
Owner

gleitz commented May 30, 2023

Try playing around with the Google query and see if you can use quotes or something like that to handle it?

@SudhakarKuma
Copy link
Author

Sure, I will give it a try and share the findings here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants