Spaces:
Sleeping
Sleeping
Create flashcards.py
Browse files- 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
|