execute filter to remove arabic vocalization on "Show answer"

17 views
Skip to first unread message

jonas.vo...@gmail.com

unread,
Feb 13, 2017, 4:25:20 PM2/13/17
to mnemosyne-proj-users
Hi everyone,

I'm using Mnemosyne to study Arabic and I love the simple interface. So no distraction while studying :).

Our professor provided us with several plugins to remove and add crêrtain information from the cards.

One of the plugins removes the vocalization from all the arabic words, so we can improve our word recognition skills.

Anyhow there is one problem with this plugin and that is that it removes the vocalization from every word for the entire study session and there is no way of checking if you remember all the kasras and fathas (vocalization) when checking the translation (by pressing the "Show answer"-Button).

So long story short I'm wondering if there is a way to reverse the filter that removes the vocalization everytime I press the "show answer"-button and adds the filter again for the next word and so on...

Thanks in advance.

Kind regards,

Jonas

Below the filter plugin code:


from mnemosyne.libmnemosyne.filter import Filter
from mnemosyne.libmnemosyne.plugin import Plugin
import re

class Vokalisierung_entfernen(Filter):
def run(self, text, card, fact_key, **render_args):
text = re.sub(ur'\u064B|\u064C|\u064D|\u064E|\u064F|\u0650|\u0652|\u0670', r'', text) # Entfernt Vokale, vergleiche http://www.alanwood.net/unicode/arabic.html
return text
class Vokalisierung_entfernenPlugin(Plugin):

name = "Vokalisierung entfernen"
description = "Entfernt Vokalisierung ausser Schadda"
components = [Vokalisierung_entfernen]

def activate(self):
Plugin.activate(self)
self.render_chain("default").\
register_filter(Vokalisierung_entfernen, in_front=False)

def deactivate(self):
Plugin.deactivate(self)
self.render_chain("default").\
unregister_filter(Vokalisierung_entfernen)

from mnemosyne.libmnemosyne.plugin import register_user_plugin
register_user_plugin(Vokalisierung_entfernenPlugin)

Peter Bienstman

unread,
Feb 14, 2017, 11:06:49 AM2/14/17
to mnemosyne-...@googlegroups.com
Hi,

I'm afraid that at the moment the code does not support this. However, at some point in the future I plan to add more language-specific features to Mnemosyne and this could be a good candidate for this (I'm studying Arabic myself :-) )

Cheers,

Peter
--
You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
To post to this group, send email to mnemosyne-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/15db90df-cac6-4d11-b97c-e8326eb4f4cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages