Code
Code
english_to_kurdish = {
"I": ""من,
"you": ""تۆ,
"he": ""ئەو,
"she": ""ئەو,
"it": ""ئەو,
"we": ""ئێمە,
"they": ""ئەوان,
"eat": ""خواردن,
"drink": ""خواردن,
"apple": ""سێو,
"water": ""ئاو,
"book": ""کتێب,
"read": ""خوێندن,
"write": ""نووسین,
"go": ""چوون,
"come": ""هاتن,
"school": ""قوتابخانە,
"house": ""خانوو,
"happy": ""دڵخۆش,
"intelligent": ""زیرەک,
"story": ""چیرۆک,
"from": ""لە,
"to": ""بۆ,
"the": ""ی,
"a": ""ێک,
"an": ""ێک,
"do": ""کردن,
"does": ""کردن,
"not": ""نا,
"is": ""ە,
"am": ""م,
"are": ""ن,
"more": ""تر,
"most": ""ترین,
"this": ""ئەم,
"that": ""ئەو,
"these": ""ئەمانە,
"those": ""ئەوانە,
"they": ""ئەوان,
"water?": ""ئاو,
"apple?": ""سێو,
"book?": ""کتێب,
"houses":""خانى,
"apples": ""سيف
pronouns = {
"personal": {
"bound": {
"i": "-"م,
"you": "-"ت,
"he": "-"ی,
"she": "-"ی,
"it": "-"ی,
"we": "-"مان,
"they": "-"یان
},
"independent": {
"i": ""من,
"you": ""تو,
"he": ""ئەو,
"she": ""ئەو,
"it": ""ئەو,
"we": ""ئێمە,
"they": ""ئەوان
}
},
"demonstrative": {
"this": ""ئەمە,
"that": ""ئەوە,
"these": ""ئەمانە,
"those": ""ئەوانە
}
}
noun_suffixes = {
"absolute": "",
"indefinite": ""ێک,
"definite": "-"ی,
"possessive": {
"i": "-"م,
"you": "-"ت,
"he": "-"ی,
"she": "-"ی,
"it": "-"ی,
"we": "-"مان,
"they": "-"یان
}
}
kurdish_verb = english_to_kurdish[verb]
conjugation_suffix = verb_conjugations[tense][subject.lower()]
negation_prefix = " "ناif negation else ""
return f"{negation_prefix}{kurdish_verb}{conjugation_suffix}"
words = sentence.split()
# Handle questions starting with "Do" or "Does"
if words[0].lower() in ["do", "does"]:
subject = words[1].lower()
verb = words[2].lower() if len(words) > 2 else None
obj_words = words[3:] if len(words) > 3 else []
# Check for negation in questions
negation = "not" in words
else:
subject = words[0].lower()
verb = words[1].lower()
obj_words = words[2:]
# Check for negation in declarative sentences
negation = "not" in words
# Translate subject
subject_kurdish = english_to_kurdish.get(subject, subject)
return kurdish_sentence.strip()
return translated_sentence