How to apply exclude filter on dictionary entries

I want to find dictionary entries of a word but excluding the domain "sex". How to achieve that?

Best Answer

Answers

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Once you have figured out how to make a call, you will need to find out how to search the output for the domains array and check whether any of the strings within match the string "sex". If you get a positive response, you can then choose not to display the entry.

  • shahoodshahood Member ✭✭
    edited May 2018

    Oh so we will have to do it through our respective code. That’s weird! “domains” is available as a filter already but it works when we want the output to contain only certain domains (equal to). IMHO it should also work when we need the output doesn’t contain certain domains (not equal to).

  • AmosDuveenAmosDuveen Member, Administrator, Moderator admin

    Hi @shahood,

    You're confusing the entries endpoint with the wordlist endpoint. You can use wordlist to filter (both inclusively and exclusively) but the output will only be a list of words. If you want to return a full entry, you need to use the entries endpoint and if you want to prevent certain content displaying then you need to code that into your program.

  • shahoodshahood Member ✭✭

    I’m not confusing both endpoints, it is just that one of these endpoints contains a feature that the other doesn’t. In my case, I want entries for a word, not a wordlist. Doing that in code would require a lot of iterations.

Sign In or Register to comment.