Sadem-12 commited on
Commit
5ac8fa2
·
verified ·
1 Parent(s): 2e1c7d8

Create flashcards.py

Browse files
Files changed (1) hide show
  1. flashcards.py +5 -0
flashcards.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ def generate_flashcards(text):
2
+ """تحويل المحتوى إلى كروت دراسية"""
3
+ sentences = text.split('. ')
4
+ flashcards = [{"السؤال": f"ما هو معنى: {sent.strip()}؟", "الإجابة": sent.strip()} for sent in sentences if len(sent) > 10]
5
+ return flashcards