facebookresearch / stopes

A library for preparing data for machine translation research (monolingual preprocessing, bitext mining, etc.) built by the FAIR NLLB team.
https://facebookresearch.github.io/stopes/
MIT License
251 stars 37 forks source link

Feat: play on paste . #49

Open greatsage-raphael opened 1 year ago

greatsage-raphael commented 1 year ago

Why ?

Usually when we paste something in the query textbox, the next action is to click on "fetch" or press enter. This feature detects a paste and automatically execute the query. Fixes #36

How ?

It uses the onPaste event listener of the input field to detect a paste operation and automatically executes the query by calling a function

Test plan

Paste filename into the input field and observe that the pasted filename automatically executes without manual intervention.

greatsage-raphael commented 1 year ago

it looks good. Can you install/run pre-commit and make sure the linter works on tsx files?

Also, is it possible to add a test for this new feature?

I'll install and rum pre-commit and write up the test as well

Celebio commented 1 year ago

Thank you @greatsage-raphael. There are too many files affected by the linter, and I am wondering if this is due to some version mismatch. In any case, can you run the linter only on the files that you modified? We can decide later if it makes sense to run it on all files, but it should be a separate commit anyway.