mvfsillva/dialetus-service

Looking for an specific expression

jaydson opened this issue · 4 comments

First, congrats @mvfsillva! Awesome and fun project 👏👏👏
I was wondering if we can evolve the API in a way we can search for an specific expression.
I mean, there's some expressions which are used in different regions and sometimes it have the same meaning and sometimes don't.
It'll be nice if the API provides the ability of discovering.

Examples:

Request

curl https://dialetus-service.now.sh/search/bah

Response

]
  {
    "region": "gauches",
    "dialect": "Bah",
    "meanings": ["Tapada", "Lento", "Disperso"],
    "examples": ["Bah, sério?!"]
  }
]

Request

curl https://dialetus-service.now.sh/search/baita

Response

]
  {
    "region": "gauches",
        "dialect": "Baita",
        "meanings": ["Grande", "Imenso"],
        "examples": ["Bah tchê, que baita de um problema tu arranjaste?!"]
  },
  {
    "region": "paulistes",
        "dialect": "Baita",
        "meanings": ["Grande", "Imenso"],
        "examples": ["Meu, que baita de um problema!"]
  }
]

With this approach we can even provide a full search functionality:

Request

curl https://dialetus-service.now.sh/search/ba

Response

]
 {
    "region": "gauches",
        "dialect": "Bah",
        "meanings": ["Tapada", "Lento", "Disperso"],
        "examples": ["Bah, sério?!"]
  },
  {
    "region": "gauches",
        "dialect": "Baita",
        "meanings": ["Grande", "Imenso"],
        "examples": ["Bah tchê, que baita de um problema tu arranjaste?!"]
  },
  {
    "region": "paulistes",
        "dialect": "Baita",
        "meanings": ["Grande", "Imenso"],
        "examples": ["Meu, que baita de um problema!"]
  },
  {
    "region": "paulistes",
         "dialect": "Bagulho",
         "meanings": ["Qualquer tipo de objeto (lapis, papel, celular)"],
         "examples": ["Empresta esse bagulho ai pra mim?", "Passa essa bagulho ai mano!"]
  }
]

Or even better, we could group by regions in the response:

]
 {
    "region": "gauches"
        "dialects": [
         {
           "dialect": "Bah",
           "meanings": ["Tapada", "Lento", "Disperso"],
           "examples": ["Bah, sério?!"]
          },
         {
          "dialect": "Baita",
          "meanings": ["Grande", "Imenso"],
          "examples": ["Bah tchê, que baita de um problema tu arranjaste?!"]
         }
    ]
  }
]

This project and idea is so rich! That's a lot of applications and ways to scale.
E.g.: Integrate with dictionaries, etymology, audio expressions, and so on.
Cool!

Have you considered GraphQL?
Perhaps it could be a good alternative to amplify the service even more 🙂

First, thank you @jaydson, I'm a fan of the Brazilian language culture and I really want to evolve this project!

About your proposals:

1 - I think it's completely valid, let's implement it?
2 - Yes, it will be nice to change for GraphQL.

What do you think?

I link this issue, I think this is very interesting. Can I implement it?

But I have one point of disagreeing with the proposal, it's about the global search

curl https://dialetus-service.now.sh/search/bah

I think it's better to follow up on the model of Google and Twitter APIs, like this:

curl https://dialetus-service.now.sh/search?q=bah

When q is the query parameter, so we can do things like this:

curl https://dialetus-service.now.sh/search?q=bah+bagulho

So in the future, this project can have other things like:

locale filter to help with to set the state.
** count**, limit and ** offset** to improve the response as a pagination list.

RFC

Twitter Search API
Google Search API

Hi, @malaquiasdev I liked this!

Would you like to implement?

Yep! assign to me please S2.