Code Monkey home page Code Monkey logo

odmiana's Introduction

Deployed

Odmiana Telegram Bot

Odmiana is an easy-to-use Telegram bot for those who are learning Polish.

It will save you from having to constantly go to different sites to find the right case or conjugation of a word. Simply send it a word and it will return all its forms. Currently, the bot only supports verbs and nouns, but I plan to add support for other parts of speech in the near future. And later, grammar cheatsheets, and possibly practical exercises to learn this beautiful language.

For example, if you send the word: "kocham", you will receive the following:

Odmiana response

Running Locally

Pre-requisites

Make sure you have installed:

  • JDK 17
  • Gradle
  • Docker and Docker Compose

Setup

  1. Ask @BotFather to create a bot for you
  2. Save the token for accessing to Telegram HTTP API
  3. Clone the project
  4. Set the following environment variables:
Environment Variable Description Default Example
TELEGRAM_USERNAME Username as you told it to @BotFather N/A odmiana_test_753_bot
TELEGRAM_TOKEN Token @BotFather sent to you N/A 1234567890:AAAAAAA-TMIrr1PZPowv3hNdHkn2eEMnjq8
MONGO_HOST MongoDB hostname localhost localhost
MONGO_PORT MongoDB port to expose 27017 27017
MONGO_USERNAME MongoDB root username root root
MONGO_PASSWORD MongoDB root password secret secret
MONGO_DATABASE MongoDB database name odmiana odmiana
  1. Go to the infrastructure and run start the MongoDB container:
cd infrastructure
docker compose up
  1. Run an application:
cd ..
./gradlew bootRun
  1. Open Telegram, find your bot and start a chat. Enjoy.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

odmiana's People

Contributors

jazzman avatar

Stargazers

 avatar

Watchers

 avatar

odmiana's Issues

Extra characters in the output

Describe the bug
For some input, there are extra words present in the result.

To Reproduce
Steps to reproduce the behavior:

  1. Send the word 'banan'
  2. See the 'Biernik' case in the response.

Expected behavior
No redundant words in the response.

Screenshots
Screenshot 2023-04-14 at 15 38 49

Additional context
These words and characters come from the links which are present on the page being parsed. Need to sanitize the output.

Translation Command

Create a new translate command. Which should work like the following to translate from the current language into Polish:

/translate_to_pl love

and from Polish to the current language:

/translate_from_pl miłość

Grammar cheat sheet: noun cases

Create a new high-level command for grammar cheat sheets. In the future on the second level, there should be buttons for different parts of speech.

Implement the 'Noun' button. Clicking on that button should show a list of buttons representing the noun cases:

  • Mianownik
  • Dopłniacz
  • ...

Clicking on these buttons returns grammar rules for creating the different forms of a noun: endings, examples, etc.

Support for numerals

Add support for numerals.
Make it possible to translate numbers into words, i.e. 15 -> piętnaście + all the forms

No translation for some words

Describe the bug
For some words, there is no translation when requesting conjugation.

To Reproduce
Steps to reproduce the behavior:

  1. Type the word 'ćwiczenie'
  2. Click on 'Send'
  3. See the response without a translation

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Screenshot 2023-04-14 at 14 49 27

Limit CI/CD actions for the new PR

Is your feature request related to a problem? Please describe.
CI/CD runs the whole flow if the pull request is created.

Describe the solution you'd like
Update CI/CD action to run only:

  • tests
  • sonarqube analysis
  • sonarqube quality gate check

Grammar cheat sheet: verb cases

Add a new 'Verb' button under the 'Grammar' command. Clicking on this button shows rules for changing a verb in different tenses.

Remove old/unused docker images from the production

After running automated deployments there are a lot of unused unnecessary docker images that stay on the production server.

Implement the automated mechanism for removing those images to keep as much free space as possible.

Implement the Healthcheck REST endpoint

Currently, there is no way to check if everything goes well after deployments.

Create a new REST endpoint to be able to see if the application and database are alive.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.