mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Make auto the default speech language and carry what was detected through
New installs start detecting instead of being locked to one language; a stored value from before this default still wins. The dictation chain asks transcribe_detected() in auto mode, records the detected code in history as speech_language, hands it to the cleanup prompt (a detected Turkish recording gets the Turkish prompt and glossary rule), and reports it on the socket reply. The stale comment claiming whisper.cpp's -l auto does not detect is corrected.
This commit is contained in:
@@ -259,6 +259,16 @@ class CleanupPrompt(DikteTest):
|
||||
def test_no_glossary_means_no_rule_about_one(self):
|
||||
self.assertEqual(cfg.Config().cleanup_prompt(), cfg.CLEANUP_PROMPT_EN)
|
||||
|
||||
def test_a_detected_turkish_recording_gets_the_turkish_prompt(self):
|
||||
"""Auto mode learns what was heard, and that decides the prompt rather
|
||||
than the interface language."""
|
||||
self.write_config({"ui_language": "en", "transcribe_prompt": "Paraşüt"})
|
||||
conf = cfg.Config()
|
||||
self.assertIn("KONUŞMACININ KULLANDIĞI İSİM VE TERİMLER",
|
||||
conf.cleanup_prompt(speech="tr"))
|
||||
self.assertIn("NAMES AND TERMS THE SPEAKER USES",
|
||||
conf.cleanup_prompt(speech="de"))
|
||||
|
||||
def test_subtitles_use_their_own_prompt(self):
|
||||
conf = cfg.Config()
|
||||
self.assertNotEqual(conf.cleanup_prompt(subtitles=True), conf.cleanup_prompt())
|
||||
|
||||
Reference in New Issue
Block a user