Add Stress / Tone support
Hello @simjanos-dev ,
I think it would be beneficial to add for the app support for the stress and tone.
The best way to support it would be add a new route in PHP and Python services
python example for Russian using StressRNN package:
from stressrnn import StressRNN
stress_rnn = StressRNN()
@route('/stress-detection', method='POST')
def stress_detection():
response.headers['Content-Type'] = 'application/json'
rawText = request.json.get('raw-text')
lang = request.json.get('lang')
stressed = ''
if lang == 'russian':
rnn_stressed_text = stress_rnn.put_stress(rawText, stress_symbol='+', accuracy_threshold=0.5, replace_similar_symbols=False)
stressed = rnn_stressed_text.replace("+", "́")
return json.dumps(stressed)
This would allow to add stress marks for the russian sentences or phrases and add support for the other languages in the future (as well tones from chinese). It could be visible in the Word panel somewhere, above Translation panel maybe if the stress/tone is available for the language or, just add stress to the lemma and word if possible.
I can work on it if you see this feature as beneficial to the app.
Hi!
Sorry for the late response. I think it would be a nice feature if it works for a high % of words. Chinese also has tones and Japanese pitch accents, which could be stored the same way.
It could be visible in the Word panel somewhere, above Translation panel maybe
I don't know where should we put it, the vocabularies don't really have any extra space (some languages also has a reading row).
I'll think about it.