Greek Stemmer availability

ckouts03ckouts03 Member Posts: 4 Contributor I
edited December 2018 in Help

Hello to all,

I am new here and from what I found, there is not an available greek stemmer. I dont even know how to build one. I did find an algorithm from the thesis of Geogios Ntaias. I searched online and found the algorithm in Ruby. I dont know  how to integrate RM with such an extension and what I should learn before doing so.

Thank you in advance all..!

Tagged:

Answers

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager

    hi @ckouts03 welcome to the community. In the Text Processing extension to RapidMiner, there are several stemming operators but as you saw not for Greek. However there is one called "Stem (Dictionary)" where you can add your own "stemming dictionary" using lists, RegEx, etc... If you search this forum, I seem to remember others that had similar questions for other languages.


    Scott

     

  • ckouts03ckouts03 Member Posts: 4 Contributor I

    thank you. I will look into it

  • ckouts03ckouts03 Member Posts: 4 Contributor I

    Hello guys!

    So, I found online an algorithm for a stemmer in python code. I am not a programmer so I dont know how to use it in rapidminer. My two mistakes are that rapidminer needs import of some pandas library I think and the function rm_main. Plus I give to the execute python process many words, so I might need an array first which I have no idea how to implement. Below is the xml of my process and the python code.

    Thanks in advance for any help. I have been struggling with it a lot.

     

    Python code:

     


    Python code:




    # -*- coding: cp1253 -*-

    ##Ελληνικό Ανοιχτό Πανεπιστήμιο - Πρόγραμμα Σπουδών Πληροφορικής
    ##Πτυχιακή Εργασία: HOU-CS-UGP-2013-18
    ##"Αλγόριθμοι Αποδοτικής Επιλογής Χαρακτηριστικών για Κατηγοριοποίηση Κειμένου στην Ελληνική Γλώσσα"
    ##Αλέξανδρος Καλαπόδης
    ##Επιβλέπων Καθηγητής: Σπύρος Λυκοθανάσης, Τμήμα Μηχανικών Η/Υ & Πληροφορικής, Πανεπιστήμιο Πάτρας

    ##Implementation in Python of the greek stemmer presented by Giorgios Ntais during his master thesis with title
    ##"Development of a Stemmer for the Greek Language" in the Department of Computer and Systems Sciences
    ##at Stockholm's University / Royal Institute of Technology.

    ##The system takes as input a word and removes its inflexional suffix according to a rule based algorithm.
    ##The algorithm follows the known Porter algorithm for the English language and it is developed according to the
    ##grammatical rules of the Modern Greek language.

    VOWELS = ['Α', 'Ε', 'Η', 'Ι', 'Ο', 'Υ', 'Ω', '’', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ', 'Ϊ', 'Ϋ']

    def ends_with(word, suffix):
    return word[len(word) - len(suffix):] == suffix

    def stem(word):

    done = len(word) <= 3

    ##rule-set 1
    ##ΓΙΑΓΙΑΔΕΣ->ΓΙΑΓ, ΟΜΑΔΕΣ->ΟΜΑΔ
    if not done:
    for suffix in ['ΙΑΔΕΣ', 'ΑΔΕΣ', 'ΑΔΩΝ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    remaining_part_does_not_end_on = True
    for s in ['ΟΚ', 'ΜΑΜ', 'ΜΑΝ', 'ΜΠΑΜΠ', 'ΠΑΤΕΡ', 'ΓΙΑΓ', 'ΝΤΑΝΤ', 'ΚΥΡ', 'ΘΕΙ', 'ΠΕΘΕΡ']:
    if ends_with(word, s):
    remaining_part_does_not_end_on = False
    break
    if remaining_part_does_not_end_on:
    word = word + 'ΑΔ'
    done = True
    break

    ##rule-set 2
    ##ΚΑΦΕΔΕΣ->ΚΑΦ, ΓΗΠΕΔΩΝ->ΓΗΠΕΔ
    if not done:
    for suffix in ['ΕΔΕΣ', 'ΕΔΩΝ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    for s in ['ΟΠ', 'ΙΠ', 'ΕΜΠ', 'ΥΠ', 'ΓΗΠ', 'ΔΑΠ', 'ΚΡΑΣΠ', 'ΜΙΛ']:
    if ends_with(word, s):
    word = word + 'ΕΔ'
    break
    done = True
    break

    ##rule-set 3
    ##ΠΑΠΠΟΥΔΩΝ->ΠΑΠΠ, ΑΡΚΟΥΔΕΣ->ΑΡΚΟΥΔ
    if not done:
    for suffix in ['ΟΥΔΕΣ', 'ΟΥΔΩΝ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    for s in ['ΑΡΚ', 'ΚΑΛΙΑΚ', 'ΠΕΤΑΛ', 'ΛΙΧ', 'ΠΛΕΞ', 'ΣΚ', 'Σ', 'ΦΛ', 'ΦΡ', 'ΒΕΛ', 'ΛΟΥΛ', 'ΧΝ', 'ΣΠ', 'ΤΡΑΓ', 'ΦΕ']:
    if ends_with(word, s):
    word = word + 'ΟΥΔ'
    break
    done = True
    break

    ##rule-set 4
    ##ΥΠΟΘΕΣΕΩΣ->ΥΠΟΘΕΣ, ΘΕΩΝ->ΘΕ
    if not done:
    for suffix in ['ΕΩΣ', 'ΕΩΝ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    for s in ['Θ', 'Δ', 'ΕΛ', 'ΓΑΛ', 'Ν', 'Π', 'ΙΔ', 'ΠΑΡ']:
    if ends_with(word, s):
    word = word + 'Ε'
    break
    done = True
    break

    ##rule-set 5
    ##ΠΑΙΔΙΑ->ΠΑΙΔ, ΤΕΛΕΙΟΥ->ΤΕΛΕΙ
    if not done:
    for suffix in ['ΙΑ', 'ΙΟΥ', 'ΙΩΝ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    for s in VOWELS:
    if ends_with(word, s):
    word = word + 'Ι'
    break
    done = True
    break

    ##rule-set 6
    ##ΖΗΛΙΑΡΙΚΟ->ΖΗΛΙΑΡ, ΑΓΡΟΙΚΟΣ->ΑΓΡΟΙΚ
    if not done:
    for suffix in ['ΙΚΑ', 'ΙΚΟΥ', 'ΙΚΩΝ', 'ΙΚΟΣ', 'ΙΚΟ', 'ΙΚΗ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΑΛ', 'ΑΔ', 'ΕΝΔ', 'ΑΜΑΝ', 'ΑΜΜΟΧΑΛ', 'ΗΘ', 'ΑΝΗΘ', 'ΑΝΤΙΔ', 'ΦΥΣ', 'ΒΡΩΜ', 'ΓΕΡ', 'ΕΞΩΔ', 'ΚΑΛΠ',
    'ΚΑΛΛΙΝ', 'ΚΑΤΑΔ', 'ΜΟΥΛ', 'ΜΠΑΝ', 'ΜΠΑΓΙΑΤ', 'ΜΠΟΛ', 'ΜΠΟΣ', 'ΝΙΤ', 'ΞΙΚ', 'ΣΥΝΟΜΗΛ', 'ΠΕΤΣ', 'ΠΙΤΣ',
    'ΠΙΚΑΝΤ', 'ΠΛΙΑΤΣ', 'ΠΟΝΤ', 'ΠΟΣΤΕΛΝ', 'ΠΡΩΤΟΔ', 'ΣΕΡΤ', 'ΣΥΝΑΔ', 'ΤΣΑΜ', 'ΥΠΟΔ', 'ΦΙΛΟΝ', 'ΦΥΛΟΔ',
    'ΧΑΣ']:
    word = word + 'ΙΚ'
    else:
    for s in VOWELS:
    if ends_with(word, s):
    word = word + 'ΙΚ'
    break
    done = True
    break

    ##rule-set 7
    ##ΑΓΑΠΑΓΑΜΕ->ΑΓΑΠ, ΑΝΑΠΑΜΕ->ΑΝΑΠΑΜ
    if not done:
    if word == 'ΑΓΑΜΕ': word = 2*word
    for suffix in ['ΗΘΗΚΑΜΕ', 'ΑΓΑΜΕ', 'ΗΣΑΜΕ', 'ΟΥΣΑΜΕ', 'ΗΚΑΜΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['Φ']:
    word = word + 'ΑΓΑΜ'
    done = True
    break
    if not done and ends_with(word, 'ΑΜΕ'):
    word = word[:len(word) - len('ΑΜΕ')]
    if word in ['ΑΝΑΠ', 'ΑΠΟΘ', 'ΑΠΟΚ', 'ΑΠΟΣΤ', 'ΒΟΥΒ', 'ΞΕΘ', 'ΟΥΛ', 'ΠΕΘ', 'ΠΙΚΡ', 'ΠΟΤ', 'ΣΙΧ', 'Χ']:
    word = word + 'ΑΜ'
    done = True

    ##rule-set 8
    ##ΑΓΑΠΗΣΑΜΕ->ΑΓΑΠ, ΤΡΑΓΑΝΕ->ΤΡΑΓΑΝ
    if not done:
    for suffix in ['ΙΟΥΝΤΑΝΕ', 'ΙΟΝΤΑΝΕ', 'ΟΥΝΤΑΝΕ', 'ΗΘΗΚΑΝΕ', 'ΟΥΣΑΝΕ', 'ΙΟΤΑΝΕ', 'ΟΝΤΑΝΕ', 'ΑΓΑΝΕ', 'ΗΣΑΝΕ',
    'ΟΤΑΝΕ', 'ΗΚΑΝΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΤΡ', 'ΤΣ', 'Φ']:
    word = word + 'ΑΓΑΝ'
    done = True
    break
    if not done and ends_with(word, 'ΑΝΕ'):
    word = word[:len(word) - len('ΑΜΕ')]
    if word in ['ΒΕΤΕΡ', 'ΒΟΥΛΚ', 'ΒΡΑΧΜ', 'Γ', 'ΔΡΑΔΟΥΜ', 'Θ', 'ΚΑΛΠΟΥΖ', 'ΚΑΣΤΕΛ', 'ΚΟΡΜΟΡ', 'ΛΑΟΠΛ', 'ΜΩΑΜΕΘ', 'Μ',
    'ΜΟΥΣΟΥΛΜ', 'Ν', 'ΟΥΛ', 'Π', 'ΠΕΛΕΚ', 'ΠΛ', 'ΠΟΛΙΣ', 'ΠΟΡΤΟΛ', 'ΣΑΡΑΚΑΤΣ', 'ΣΟΥΛΤ', 'ΤΣΑΡΛΑΤ', 'ΟΡΦ',
    'ΤΣΙΓΓ', 'ΤΣΟΠ', 'ΦΩΤΟΣΤΕΦ', 'Χ', 'ΨΥΧΟΠΛ', 'ΑΓ', 'ΟΡΦ', 'ΓΑΛ', 'ΓΕΡ', 'ΔΕΚ', 'ΔΙΠΛ', 'ΑΜΕΡΙΚΑΝ', 'ΟΥΡ',
    'ΠΙΘ', 'ΠΟΥΡΙΤ', 'Σ', 'ΖΩΝΤ', 'ΙΚ', 'ΚΑΣΤ', 'ΚΟΠ', 'ΛΙΧ', 'ΛΟΥΘΗΡ', 'ΜΑΙΝΤ', 'ΜΕΛ', 'ΣΙΓ', 'ΣΠ', 'ΣΤΕΓ',
    'ΤΡΑΓ', 'ΤΣΑΓ', 'Φ', 'ΕΡ', 'ΑΔΑΠ', 'ΑΘΙΓΓ', 'ΑΜΗΧ', 'ΑΝΙΚ', 'ΑΝΟΡΓ', 'ΑΠΗΓ', 'ΑΠΙΘ', 'ΑΤΣΙΓΓ', 'ΒΑΣ',
    'ΒΑΣΚ', 'ΒΑΘΥΓΑΛ', 'ΒΙΟΜΗΧ', 'ΒΡΑΧΥΚ', 'ΔΙΑΤ', 'ΔΙΑΦ', 'ΕΝΟΡΓ', 'ΘΥΣ', 'ΚΑΠΝΟΒΙΟΜΗΧ', 'ΚΑΤΑΓΑΛ', 'ΚΛΙΒ',
    'ΚΟΙΛΑΡΦ', 'ΛΙΒ', 'ΜΕΓΛΟΒΙΟΜΗΧ', 'ΜΙΚΡΟΒΙΟΜΗΧ', 'ΝΤΑΒ', 'ΞΗΡΟΚΛΙΒ', 'ΟΛΙΓΟΔΑΜ', 'ΟΛΟΓΑΛ', 'ΠΕΝΤΑΡΦ',
    'ΠΕΡΗΦ', 'ΠΕΡΙΤΡ', 'ΠΛΑΤ', 'ΠΟΛΥΔΑΠ', 'ΠΟΛΥΜΗΧ', 'ΣΤΕΦ', 'ΤΑΒ', 'ΤΕΤ', 'ΥΠΕΡΗΦ', 'ΥΠΟΚΟΠ', 'ΧΑΜΗΛΟΔΑΠ',
    'ΨΗΛΟΤΑΒ']:
    word = word + 'ΑΝ'
    else:
    for s in VOWELS:
    if ends_with(word, s):
    word = word + 'ΑΝ'
    break
    done = True

    ##rule-set 9
    ##ΑΓΑΠΗΣΕΤΕ->ΑΓΑΠ, ΒΕΝΕΤΕ->ΒΕΝΕΤ
    if not done:
    if ends_with(word, 'ΗΣΕΤΕ'):
    word = word[:len(word) - len('ΗΣΕΤΕ')]
    done = True
    elif ends_with(word, 'ΕΤΕ'):
    word = word[:len(word) - len('ΕΤΕ')]
    if word in ['ΑΒΑΡ', 'ΒΕΝ', 'ΕΝΑΡ', 'ΑΒΡ', 'ΑΔ', 'ΑΘ', 'ΑΝ', 'ΑΠΛ', 'ΒΑΡΟΝ', 'ΝΤΡ', 'ΣΚ', 'ΚΟΠ', 'ΜΠΟΡ', 'ΝΙΦ', 'ΠΑΓ',
    'ΠΑΡΑΚΑΛ', 'ΣΕΡΠ', 'ΣΚΕΛ', 'ΣΥΡΦ', 'ΤΟΚ', 'Υ', 'Δ', 'ΕΜ', 'ΘΑΡΡ', 'Θ']:
    word = word + 'ΕΤ'
    else:
    for s in ['ΟΔ', 'ΑΙΡ', 'ΦΟΡ', 'ΤΑΘ', 'ΔΙΑΘ', 'ΣΧ', 'ΕΝΔ', 'ΕΥΡ', 'ΤΙΘ', 'ΥΠΕΡΘ', 'ΡΑΘ', 'ΕΝΘ', 'ΡΟΘ', 'ΣΘ', 'ΠΥΡ',
    'ΑΙΝ', 'ΣΥΝΔ', 'ΣΥΝ', 'ΣΥΝΘ', 'ΧΩΡ', 'ΠΟΝ', 'ΒΡ', 'ΚΑΘ', 'ΕΥΘ', 'ΕΚΘ', 'ΝΕΤ', 'ΡΟΝ', 'ΑΡΚ', 'ΒΑΡ', 'ΒΟΛ',
    'ΩΦΕΛ'] + VOWELS:
    if ends_with(word, s):
    word = word + 'ΕΤ'
    break
    done = True

    ##rule-set 10
    ##ΑΓΑΠΩΝΤΑΣ->ΑΓΑΠ, ΞΕΝΟΦΩΝΤΑΣ->ΞΕΝΟΦΩΝ
    if not done:
    for suffix in ['ΟΝΤΑΣ', 'ΩΝΤΑΣ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΑΡΧ']:
    word = word + 'ΟΝΤ'
    elif word in ['ΞΕΝΟΦ', 'ΚΡΕ']:
    word = word + 'ΩΝΤ'
    done = True
    break

    ##rule-set 11
    ##ΑΓΑΠΙΟΜΑΣΤΕ->ΑΓΑΠ, ΟΝΟΜΑΣΤΕ->ΟΝΟΜΑΣΤ
    if not done:
    for suffix in ['ΙΟΜΑΣΤΕ', 'ΟΜΑΣΤΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΟΝ']:
    word = word + 'ΟΜΑΣΤ'
    done = True
    break

    ##rule-set 12
    ##ΑΓΑΠΙΕΣΤΕ->ΑΓΑΠ, ΠΙΕΣΤΕ->ΠΙΕΣΤ
    if not done:
    for suffix in ['ΙΕΣΤΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['Π', 'ΑΠ', 'ΣΥΜΠ', 'ΑΣΥΜΠ', 'ΚΑΤΑΠ', 'ΜΕΤΑΜΦ']:
    word = word + 'ΙΕΣΤ'
    done = True
    break
    if not done:
    for suffix in ['ΕΣΤΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΑΛ', 'ΑΡ', 'ΕΚΤΕΛ', 'Ζ', 'Μ', 'Ξ', 'ΠΑΡΑΚΑΛ', 'ΑΡ', 'ΠΡΟ', 'ΝΙΣ']:
    word = word + 'ΕΣΤ'
    done = True
    break

    ##rule-set 13
    ##ΧΤΙΣΤΗΚΕ->ΧΤΙΣΤ, ΔΙΑΘΗΚΕΣ->ΔΙΑΘΗΚ
    if not done:
    for suffix in ['ΗΘΗΚΑ', 'ΗΘΗΚΕΣ', 'ΗΘΗΚΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    done = True
    break
    if not done:
    for suffix in ['ΗΚΑ', 'ΗΚΕΣ', 'ΗΚΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΔΙΑΘ', 'Θ', 'ΠΑΡΑΚΑΤΑΘ', 'ΠΡΟΣΘ', 'ΣΥΝΘ']:
    word = word + 'ΗΚ'
    else:
    for suffix in ['ΣΚΩΛ', 'ΣΚΟΥΛ', 'ΝΑΡΘ', 'ΣΦ', 'ΟΘ', 'ΠΙΘ']:
    if ends_with(word, suffix):
    word = word + 'ΗΚ'
    break
    done = True
    break

    ##rule-set 14
    ##ΧΤΥΠΟΥΣΕΣ->ΧΤΥΠ, ΜΕΔΟΥΣΕΣ->ΜΕΔΟΥΣ
    if not done:
    for suffix in ['ΟΥΣΑ', 'ΟΥΣΕΣ', 'ΟΥΣΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΦΑΡΜΑΚ', 'ΧΑΔ', 'ΑΓΚ', 'ΑΝΑΡΡ', 'ΒΡΟΜ', 'ΕΚΛΙΠ', 'ΛΑΜΠΙΔ', 'ΛΕΧ', 'Μ', 'ΠΑΤ', 'Ρ', 'Λ', 'ΜΕΔ', 'ΜΕΣΑΖ',
    'ΥΠΟΤΕΙΝ', 'ΑΜ', 'ΑΙΘ', 'ΑΝΗΚ', 'ΔΕΣΠΟΖ', 'ΕΝΔΙΑΦΕΡ', 'ΔΕ', 'ΔΕΥΤΕΡΕΥ', 'ΚΑΘΑΡΕΥ', 'ΠΛΕ', 'ΤΣΑ']:
    word = word + 'ΟΥΣ'
    else:
    for s in ['ΠΟΔΑΡ', 'ΒΛΕΠ', 'ΠΑΝΤΑΧ', 'ΦΡΥΔ', 'ΜΑΝΤΙΛ', 'ΜΑΛΛ', 'ΚΥΜΑΤ', 'ΛΑΧ', 'ΛΗΓ', 'ΦΑΓ', 'ΟΜ', 'ΠΡΩΤ'] + VOWELS:
    if ends_with(word, s):
    word = word + 'ΟΥΣ'
    break
    done = True
    break

    ##rule-set 15
    #ΚΟΛΛΑΓΕΣ->ΚΟΛΛ, ΑΒΑΣΤΑΓΑ->ΑΒΑΣΤ
    if not done:
    for suffix in ['ΑΓΑ', 'ΑΓΕΣ', 'ΑΓΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΑΒΑΣΤ', 'ΠΟΛΥΦ', 'ΑΔΗΦ', 'ΠΑΜΦ', 'Ρ', 'ΑΣΠ', 'ΑΦ', 'ΑΜΑΛ', 'ΑΜΑΛΛΙ', 'ΑΝΥΣΤ', 'ΑΠΕΡ', 'ΑΣΠΑΡ', 'ΑΧΑΡ',
    'ΔΕΡΒΕΝ', 'ΔΡΟΣΟΠ', 'ΞΕΦ', 'ΝΕΟΠ', 'ΝΟΜΟΤ', 'ΟΛΟΠ', 'ΟΜΟΤ', 'ΠΡΟΣΤ', 'ΠΡΟΣΩΠΟΠ', 'ΣΥΜΠ', 'ΣΥΝΤ', 'Τ',
    'ΥΠΟΤ', 'ΧΑΡ', 'ΑΕΙΠ', 'ΑΙΜΟΣΤ', 'ΑΝΥΠ', 'ΑΠΟΤ', 'ΑΡΤΙΠ', 'ΔΙΑΤ', 'ΕΝ', 'ΕΠΙΤ', 'ΚΡΟΚΑΛΟΠ', 'ΣΙΔΗΡΟΠ',
    'Λ', 'ΝΑΥ', 'ΟΥΛΑΜ', 'ΟΥΡ', 'Π', 'ΤΡ', 'Μ']:
    word = word + 'ΑΓ'
    else:
    for s in ['ΟΦ', 'ΠΕΛ', 'ΧΟΡΤ', 'ΣΦ', 'ΡΠ', 'ΦΡ', 'ΠΡ', 'ΛΟΧ', 'ΣΜΗΝ']:
    # ΑΦΑΙΡΕΘΗΚΕ: 'ΛΛ'
    if ends_with(word, s):
    if not word in ['ΨΟΦ', 'ΝΑΥΛΟΧ']:
    word = word + 'ΑΓ'
    break
    done = True
    break

    ##rule-set 16
    ##ΑΓΑΠΗΣΕ->ΑΓΑΠ, ΝΗΣΟΥ->ΝΗΣ
    if not done:
    for suffix in ['ΗΣΕ', 'ΗΣΟΥ', 'ΗΣΑ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['Ν', 'ΧΕΡΣΟΝ', 'ΔΩΔΕΚΑΝ', 'ΕΡΗΜΟΝ', 'ΜΕΓΑΛΟΝ', 'ΕΠΤΑΝ', 'ΑΓΑΘΟΝ']:
    word = word + 'ΗΣ'
    done = True
    break

    ##rule-set 17
    ##ΑΓΑΠΗΣΤΕ->ΑΓΑΠ, ΣΒΗΣΤΕ->ΣΒΗΣΤ
    if not done:
    for suffix in ['ΗΣΤΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΑΣΒ', 'ΣΒ', 'ΑΧΡ', 'ΧΡ', 'ΑΠΛ', 'ΑΕΙΜΝ', 'ΔΥΣΧΡ', 'ΕΥΧΡ', 'ΚΟΙΝΟΧΡ', 'ΠΑΛΙΜΨ']:
    word = word + 'ΗΣΤ'
    done = True
    break

    ##rule-set 18
    ##ΑΓΑΠΟΥΝΕ->ΑΓΑΠ, ΣΠΙΟΥΝΕ->ΣΠΙΟΥΝ
    if not done:
    for suffix in ['ΟΥΝΕ', 'ΗΣΟΥΝΕ', 'ΗΘΟΥΝΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['Ν', 'Ρ', 'ΣΠΙ', 'ΣΤΡΑΒΟΜΟΥΤΣ', 'ΚΑΚΟΜΟΥΤΣ', 'ΕΞΩΝ']:
    word = word + 'OYN'
    done = True
    break

    ##rule-set 19
    ##ΑΓΑΠΟΥΜΕ->ΑΓΑΠ, ΦΟΥΜΕ->ΦΟΥΜ
    if not done:
    for suffix in ['ΟΥΜΕ', 'ΗΣΟΥΜΕ', 'ΗΘΟΥΜΕ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    if word in ['ΠΑΡΑΣΟΥΣ', 'Φ', 'Χ', 'ΩΡΙΟΠΛ', 'ΑΖ', 'ΑΛΛΟΣΟΥΣ', 'ΑΣΟΥΣ']:
    word = word + 'ΟΥΜ'
    done = True
    break

    ##rule-set 20
    ##ΚΥΜΑΤΑ->ΚΥΜ, ΧΩΡΑΤΟ->ΧΩΡΑΤ
    if not done:
    for suffix in ['ΜΑΤΑ', 'ΜΑΤΩΝ', 'ΜΑΤΟΣ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    word = word + 'Μ'
    done = True
    break

    ##rule-set 21
    if not done:
    for suffix in ['ΙΟΝΤΟΥΣΑΝ', 'ΙΟΥΜΑΣΤΕ', 'ΙΟΜΑΣΤΑΝ', 'ΙΟΣΑΣΤΑΝ', 'ΟΝΤΟΥΣΑΝ', 'ΙΟΣΑΣΤΕ', 'ΙΕΜΑΣΤΕ', 'ΙΕΣΑΣΤΕ', 'ΙΟΜΟΥΝΑ',
    'ΙΟΣΟΥΝΑ', 'ΙΟΥΝΤΑΙ', 'ΙΟΥΝΤΑΝ', 'ΗΘΗΚΑΤΕ', 'ΟΜΑΣΤΑΝ', 'ΟΣΑΣΤΑΝ', 'ΟΥΜΑΣΤΕ', 'ΙΟΜΟΥΝ', 'ΙΟΝΤΑΝ', 'ΙΟΣΟΥΝ',
    'ΗΘΕΙΤΕ', 'ΗΘΗΚΑΝ', 'ΟΜΟΥΝΑ', 'ΟΣΑΣΤΕ', 'ΟΣΟΥΝΑ', 'ΟΥΝΤΑΙ', 'ΟΥΝΤΑΝ', 'ΟΥΣΑΤΕ', 'ΑΓΑΤΕ', 'ΕΙΤΑΙ', 'ΙΕΜΑΙ',
    'ΙΕΤΑΙ', 'ΙΕΣΑΙ', 'ΙΟΤΑΝ', 'ΙΟΥΜΑ', 'ΗΘΕΙΣ', 'ΗΘΟΥΝ', 'ΗΚΑΤΕ', 'ΗΣΑΤΕ', 'ΗΣΟΥΝ', 'ΟΜΟΥΝ', 'ΟΝΤΑΙ',
    'ΟΝΤΑΝ', 'ΟΣΟΥΝ', 'ΟΥΜΑΙ', 'ΟΥΣΑΝ', 'ΑΓΑΝ', 'ΑΜΑΙ', 'ΑΣΑΙ', 'ΑΤΑΙ', 'ΕΙΤΕ', 'ΕΣΑΙ', 'ΕΤΑΙ', 'ΗΔΕΣ',
    'ΗΔΩΝ', 'ΗΘΕΙ', 'ΗΚΑΝ', 'ΗΣΑΝ', 'ΗΣΕΙ', 'ΗΣΕΣ', 'ΟΜΑΙ', 'ΟΤΑΝ', 'ΑΕΙ', 'ΕΙΣ', 'ΗΘΩ', 'ΗΣΩ', 'ΟΥΝ',
    'ΟΥΣ', 'ΑΝ', 'ΑΣ', 'ΑΩ', 'ΕΙ', 'ΕΣ', 'ΗΣ', 'ΟΙ', 'ΟΝ', 'ΟΣ', 'ΟΥ', 'ΥΣ', 'ΩΝ', 'ΩΣ', 'Α', 'Ε', 'Ι', 'Η',
    'Ο', 'Υ', 'Ω']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    break

    ##rule-set 22
    ##ΠΛΗΣΙΕΣΤΑΤΟΣ->ΠΛΥΣΙ, ΜΕΓΑΛΥΤΕΡΗ->ΜΕΓΑΛ, ΚΟΝΤΟΤΕΡΟ->ΚΟΝΤ
    if not done:
    for suffix in ['ΕΣΤΕΡ', 'ΕΣΤΑΤ', 'ΟΤΕΡ', 'ΟΤΑΤ', 'ΥΤΕΡ', 'ΥΤΑΤ', 'ΩΤΕΡ', 'ΩΤΑΤ']:
    if ends_with(word, suffix):
    word = word[:len(word) - len(suffix)]
    break

    return word
    <?xml version="1.0" encoding="UTF-8"?><process version="8.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="8.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="subprocess" compatibility="8.2.001" expanded="true" height="103" name="editing of words" width="90" x="112" y="85">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="8.2.001" expanded="true" height="68" name="Retrieve Book42 (2)" width="90" x="45" y="34">
    <parameter key="repository_entry" value="//Local Repository/data/Book42"/>
    </operator>
    <operator activated="true" class="nominal_to_text" compatibility="8.2.001" expanded="true" height="82" name="Nominal to Text (3)" width="90" x="179" y="34"/>
    <operator activated="true" class="text:process_document_from_data" compatibility="8.1.000" expanded="true" height="82" name="Process Documents from Data (3)" width="90" x="313" y="34">
    <parameter key="keep_text" value="true"/>
    <parameter key="prune_method" value="percentual"/>
    <parameter key="prune_below_percent" value="1.0"/>
    <parameter key="prune_above_percent" value="100.0"/>
    <list key="specify_weights"/>
    <process expanded="true">
    <operator activated="true" class="text:transform_cases" compatibility="8.1.000" expanded="true" height="68" name="Transform Cases (3)" width="90" x="45" y="34"/>
    <operator activated="true" class="text:tokenize" compatibility="8.1.000" expanded="true" height="68" name="Tokenize (3)" width="90" x="179" y="34"/>
    <operator activated="true" class="text:filter_by_length" compatibility="8.1.000" expanded="true" height="68" name="Filter Tokens (2)" width="90" x="313" y="34">
    <parameter key="min_chars" value="2"/>
    <parameter key="max_chars" value="30"/>
    </operator>
    <operator activated="true" class="text:filter_stopwords_dictionary" compatibility="8.1.000" expanded="true" height="82" name="Filter Stopwords (2)" width="90" x="447" y="34">
    <parameter key="file" value="C:\Users\chrysk\Documents\job\Virkia\greekstopwords.txt"/>
    </operator>
    <operator activated="true" class="text:replace_tokens" compatibility="8.1.000" expanded="true" height="68" name="Replace Tokens (2)" width="90" x="581" y="34">
    <list key="replace_dictionary">
    <parameter key="ά" value="α"/>
    <parameter key="έ" value="ε"/>
    <parameter key="ή" value="η"/>
    <parameter key="ό" value="ο"/>
    <parameter key="ί" value="ι"/>
    <parameter key="ύ" value="υ"/>
    <parameter key="ώ" value="ω"/>
    <parameter key="ΐ" value="ϊ"/>
    <parameter key="ΰ" value="ϋ"/>
    </list>
    </operator>
    <operator activated="true" class="text:transform_cases" compatibility="8.1.000" expanded="true" height="68" name="Transform Cases (4)" width="90" x="581" y="187">
    <parameter key="transform_to" value="upper case"/>
    </operator>
    <connect from_port="document" to_op="Transform Cases (3)" to_port="document"/>
    <connect from_op="Transform Cases (3)" from_port="document" to_op="Tokenize (3)" to_port="document"/>
    <connect from_op="Tokenize (3)" from_port="document" to_op="Filter Tokens (2)" to_port="document"/>
    <connect from_op="Filter Tokens (2)" from_port="document" to_op="Filter Stopwords (2)" to_port="document"/>
    <connect from_op="Filter Stopwords (2)" from_port="document" to_op="Replace Tokens (2)" to_port="document"/>
    <connect from_op="Replace Tokens (2)" from_port="document" to_op="Transform Cases (4)" to_port="document"/>
    <connect from_op="Transform Cases (4)" from_port="document" to_port="document 1"/>
    <portSpacing port="source_document" spacing="0"/>
    <portSpacing port="sink_document 1" spacing="0"/>
    <portSpacing port="sink_document 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="text:wordlist_to_data" compatibility="8.1.000" expanded="true" height="82" name="WordList to Data (2)" width="90" x="447" y="34"/>
    <operator activated="true" class="select_attributes" compatibility="8.2.001" expanded="true" height="82" name="Select Attributes (2)" width="90" x="581" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="word"/>
    </operator>
    <operator activated="true" class="nominal_to_text" compatibility="8.2.001" expanded="true" height="82" name="Nominal to Text (4)" width="90" x="715" y="34"/>
    <connect from_op="Retrieve Book42 (2)" from_port="output" to_op="Nominal to Text (3)" to_port="example set input"/>
    <connect from_op="Nominal to Text (3)" from_port="example set output" to_op="Process Documents from Data (3)" to_port="example set"/>
    <connect from_op="Process Documents from Data (3)" from_port="word list" to_op="WordList to Data (2)" to_port="word list"/>
    <connect from_op="WordList to Data (2)" from_port="example set" to_op="Select Attributes (2)" to_port="example set input"/>
    <connect from_op="Select Attributes (2)" from_port="example set output" to_op="Nominal to Text (4)" to_port="example set input"/>
    <connect from_op="Nominal to Text (4)" from_port="example set output" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    <portSpacing port="sink_out 3" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="python_scripting:execute_python" compatibility="7.4.000" expanded="true" height="82" name="Execute Python" width="90" x="313" y="187">
    <parameter key="script" value="&#10;import pandas&#10;# -*- coding: cp1253 -*-&#10;&#10;##Ελληνικό Ανοιχτό Πανεπιστήμιο - Πρόγραμμα Σπουδών Πληροφορικής&#10;##Πτυχιακή Εργασία: HOU-CS-UGP-2013-18&#10;##&quot;Αλγόριθμοι Αποδοτικής Επιλογής Χαρακτηριστικών για Κατηγοριοποίηση Κειμένου στην Ελληνική Γλώσσα&quot;&#10;##Αλέξανδρος Καλαπόδης&#10;##Επιβλέπων Καθηγητής: Σπύρος Λυκοθανάσης, Τμήμα Μηχανικών Η/Υ &amp; Πληροφορικής, Πανεπιστήμιο Πάτρας&#10;&#10;##Implementation in Python of the greek stemmer presented by Giorgios Ntais during his master thesis with title&#10;##&quot;Development of a Stemmer for the Greek Language&quot; in the Department of Computer and Systems Sciences&#10;##at Stockholm's University / Royal Institute of Technology.&#10;&#10;##The system takes as input a word and removes its inflexional suffix according to a rule based algorithm.&#10;##The algorithm follows the known Porter algorithm for the English language and it is developed according to the&#10;##grammatical rules of the Modern Greek language.&#10;&#10;VOWELS = ['Α', 'Ε', 'Η', 'Ι', 'Ο', 'Υ', 'Ω', '’', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ', 'Ϊ', 'Ϋ']&#10;&#10;def ends_with(word, suffix):&#10; return word[len(word) - len(suffix):] == suffix&#10;&#10;def stem(word):&#10;&#10; done = len(word) &lt;= 3&#10; &#10; ##rule-set 1&#10; ##ΓΙΑΓΙΑΔΕΣ-&gt;ΓΙΑΓ, ΟΜΑΔΕΣ-&gt;ΟΜΑΔ&#10; if not done:&#10; for suffix in ['ΙΑΔΕΣ', 'ΑΔΕΣ', 'ΑΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; remaining_part_does_not_end_on = True&#10; for s in ['ΟΚ', 'ΜΑΜ', 'ΜΑΝ', 'ΜΠΑΜΠ', 'ΠΑΤΕΡ', 'ΓΙΑΓ', 'ΝΤΑΝΤ', 'ΚΥΡ', 'ΘΕΙ', 'ΠΕΘΕΡ']:&#10; if ends_with(word, s):&#10; remaining_part_does_not_end_on = False&#10; break&#10; if remaining_part_does_not_end_on:&#10; word = word + 'ΑΔ'&#10; done = True&#10; break&#10;&#10; ##rule-set 2&#10; ##ΚΑΦΕΔΕΣ-&gt;ΚΑΦ, ΓΗΠΕΔΩΝ-&gt;ΓΗΠΕΔ&#10; if not done:&#10; for suffix in ['ΕΔΕΣ', 'ΕΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['ΟΠ', 'ΙΠ', 'ΕΜΠ', 'ΥΠ', 'ΓΗΠ', 'ΔΑΠ', 'ΚΡΑΣΠ', 'ΜΙΛ']:&#10; if ends_with(word, s):&#10; word = word + 'ΕΔ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 3&#10; ##ΠΑΠΠΟΥΔΩΝ-&gt;ΠΑΠΠ, ΑΡΚΟΥΔΕΣ-&gt;ΑΡΚΟΥΔ&#10; if not done:&#10; for suffix in ['ΟΥΔΕΣ', 'ΟΥΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['ΑΡΚ', 'ΚΑΛΙΑΚ', 'ΠΕΤΑΛ', 'ΛΙΧ', 'ΠΛΕΞ', 'ΣΚ', 'Σ', 'ΦΛ', 'ΦΡ', 'ΒΕΛ', 'ΛΟΥΛ', 'ΧΝ', 'ΣΠ', 'ΤΡΑΓ', 'ΦΕ']:&#10; if ends_with(word, s):&#10; word = word + 'ΟΥΔ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 4&#10; ##ΥΠΟΘΕΣΕΩΣ-&gt;ΥΠΟΘΕΣ, ΘΕΩΝ-&gt;ΘΕ&#10; if not done:&#10; for suffix in ['ΕΩΣ', 'ΕΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['Θ', 'Δ', 'ΕΛ', 'ΓΑΛ', 'Ν', 'Π', 'ΙΔ', 'ΠΑΡ']:&#10; if ends_with(word, s):&#10; word = word + 'Ε'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 5&#10; ##ΠΑΙΔΙΑ-&gt;ΠΑΙΔ, ΤΕΛΕΙΟΥ-&gt;ΤΕΛΕΙ&#10; if not done:&#10; for suffix in ['ΙΑ', 'ΙΟΥ', 'ΙΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'Ι'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 6&#10; ##ΖΗΛΙΑΡΙΚΟ-&gt;ΖΗΛΙΑΡ, ΑΓΡΟΙΚΟΣ-&gt;ΑΓΡΟΙΚ&#10; if not done:&#10; for suffix in ['ΙΚΑ', 'ΙΚΟΥ', 'ΙΚΩΝ', 'ΙΚΟΣ', 'ΙΚΟ', 'ΙΚΗ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΛ', 'ΑΔ', 'ΕΝΔ', 'ΑΜΑΝ', 'ΑΜΜΟΧΑΛ', 'ΗΘ', 'ΑΝΗΘ', 'ΑΝΤΙΔ', 'ΦΥΣ', 'ΒΡΩΜ', 'ΓΕΡ', 'ΕΞΩΔ', 'ΚΑΛΠ',&#10; 'ΚΑΛΛΙΝ', 'ΚΑΤΑΔ', 'ΜΟΥΛ', 'ΜΠΑΝ', 'ΜΠΑΓΙΑΤ', 'ΜΠΟΛ', 'ΜΠΟΣ', 'ΝΙΤ', 'ΞΙΚ', 'ΣΥΝΟΜΗΛ', 'ΠΕΤΣ', 'ΠΙΤΣ',&#10; 'ΠΙΚΑΝΤ', 'ΠΛΙΑΤΣ', 'ΠΟΝΤ', 'ΠΟΣΤΕΛΝ', 'ΠΡΩΤΟΔ', 'ΣΕΡΤ', 'ΣΥΝΑΔ', 'ΤΣΑΜ', 'ΥΠΟΔ', 'ΦΙΛΟΝ', 'ΦΥΛΟΔ',&#10; 'ΧΑΣ']:&#10; word = word + 'ΙΚ'&#10; else:&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΙΚ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 7&#10; ##ΑΓΑΠΑΓΑΜΕ-&gt;ΑΓΑΠ, ΑΝΑΠΑΜΕ-&gt;ΑΝΑΠΑΜ&#10; if not done:&#10; if word == 'ΑΓΑΜΕ': word = 2*word&#10; for suffix in ['ΗΘΗΚΑΜΕ', 'ΑΓΑΜΕ', 'ΗΣΑΜΕ', 'ΟΥΣΑΜΕ', 'ΗΚΑΜΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Φ']:&#10; word = word + 'ΑΓΑΜ'&#10; done = True&#10; break&#10; if not done and ends_with(word, 'ΑΜΕ'):&#10; word = word[:len(word) - len('ΑΜΕ')]&#10; if word in ['ΑΝΑΠ', 'ΑΠΟΘ', 'ΑΠΟΚ', 'ΑΠΟΣΤ', 'ΒΟΥΒ', 'ΞΕΘ', 'ΟΥΛ', 'ΠΕΘ', 'ΠΙΚΡ', 'ΠΟΤ', 'ΣΙΧ', 'Χ']:&#10; word = word + 'ΑΜ'&#10; done = True&#10;&#10; ##rule-set 8&#10; ##ΑΓΑΠΗΣΑΜΕ-&gt;ΑΓΑΠ, ΤΡΑΓΑΝΕ-&gt;ΤΡΑΓΑΝ&#10; if not done:&#10; for suffix in ['ΙΟΥΝΤΑΝΕ', 'ΙΟΝΤΑΝΕ', 'ΟΥΝΤΑΝΕ', 'ΗΘΗΚΑΝΕ', 'ΟΥΣΑΝΕ', 'ΙΟΤΑΝΕ', 'ΟΝΤΑΝΕ', 'ΑΓΑΝΕ', 'ΗΣΑΝΕ',&#10; 'ΟΤΑΝΕ', 'ΗΚΑΝΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΤΡ', 'ΤΣ', 'Φ']:&#10; word = word + 'ΑΓΑΝ'&#10; done = True&#10; break&#10; if not done and ends_with(word, 'ΑΝΕ'):&#10; word = word[:len(word) - len('ΑΜΕ')]&#10; if word in ['ΒΕΤΕΡ', 'ΒΟΥΛΚ', 'ΒΡΑΧΜ', 'Γ', 'ΔΡΑΔΟΥΜ', 'Θ', 'ΚΑΛΠΟΥΖ', 'ΚΑΣΤΕΛ', 'ΚΟΡΜΟΡ', 'ΛΑΟΠΛ', 'ΜΩΑΜΕΘ', 'Μ',&#10; 'ΜΟΥΣΟΥΛΜ', 'Ν', 'ΟΥΛ', 'Π', 'ΠΕΛΕΚ', 'ΠΛ', 'ΠΟΛΙΣ', 'ΠΟΡΤΟΛ', 'ΣΑΡΑΚΑΤΣ', 'ΣΟΥΛΤ', 'ΤΣΑΡΛΑΤ', 'ΟΡΦ',&#10; 'ΤΣΙΓΓ', 'ΤΣΟΠ', 'ΦΩΤΟΣΤΕΦ', 'Χ', 'ΨΥΧΟΠΛ', 'ΑΓ', 'ΟΡΦ', 'ΓΑΛ', 'ΓΕΡ', 'ΔΕΚ', 'ΔΙΠΛ', 'ΑΜΕΡΙΚΑΝ', 'ΟΥΡ',&#10; 'ΠΙΘ', 'ΠΟΥΡΙΤ', 'Σ', 'ΖΩΝΤ', 'ΙΚ', 'ΚΑΣΤ', 'ΚΟΠ', 'ΛΙΧ', 'ΛΟΥΘΗΡ', 'ΜΑΙΝΤ', 'ΜΕΛ', 'ΣΙΓ', 'ΣΠ', 'ΣΤΕΓ',&#10; 'ΤΡΑΓ', 'ΤΣΑΓ', 'Φ', 'ΕΡ', 'ΑΔΑΠ', 'ΑΘΙΓΓ', 'ΑΜΗΧ', 'ΑΝΙΚ', 'ΑΝΟΡΓ', 'ΑΠΗΓ', 'ΑΠΙΘ', 'ΑΤΣΙΓΓ', 'ΒΑΣ',&#10; 'ΒΑΣΚ', 'ΒΑΘΥΓΑΛ', 'ΒΙΟΜΗΧ', 'ΒΡΑΧΥΚ', 'ΔΙΑΤ', 'ΔΙΑΦ', 'ΕΝΟΡΓ', 'ΘΥΣ', 'ΚΑΠΝΟΒΙΟΜΗΧ', 'ΚΑΤΑΓΑΛ', 'ΚΛΙΒ',&#10; 'ΚΟΙΛΑΡΦ', 'ΛΙΒ', 'ΜΕΓΛΟΒΙΟΜΗΧ', 'ΜΙΚΡΟΒΙΟΜΗΧ', 'ΝΤΑΒ', 'ΞΗΡΟΚΛΙΒ', 'ΟΛΙΓΟΔΑΜ', 'ΟΛΟΓΑΛ', 'ΠΕΝΤΑΡΦ',&#10; 'ΠΕΡΗΦ', 'ΠΕΡΙΤΡ', 'ΠΛΑΤ', 'ΠΟΛΥΔΑΠ', 'ΠΟΛΥΜΗΧ', 'ΣΤΕΦ', 'ΤΑΒ', 'ΤΕΤ', 'ΥΠΕΡΗΦ', 'ΥΠΟΚΟΠ', 'ΧΑΜΗΛΟΔΑΠ',&#10; 'ΨΗΛΟΤΑΒ']:&#10; word = word + 'ΑΝ'&#10; else:&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΑΝ'&#10; break&#10; done = True&#10;&#10; ##rule-set 9&#10; ##ΑΓΑΠΗΣΕΤΕ-&gt;ΑΓΑΠ, ΒΕΝΕΤΕ-&gt;ΒΕΝΕΤ&#10; if not done:&#10; if ends_with(word, 'ΗΣΕΤΕ'):&#10; word = word[:len(word) - len('ΗΣΕΤΕ')]&#10; done = True&#10; elif ends_with(word, 'ΕΤΕ'):&#10; word = word[:len(word) - len('ΕΤΕ')]&#10; if word in ['ΑΒΑΡ', 'ΒΕΝ', 'ΕΝΑΡ', 'ΑΒΡ', 'ΑΔ', 'ΑΘ', 'ΑΝ', 'ΑΠΛ', 'ΒΑΡΟΝ', 'ΝΤΡ', 'ΣΚ', 'ΚΟΠ', 'ΜΠΟΡ', 'ΝΙΦ', 'ΠΑΓ',&#10; 'ΠΑΡΑΚΑΛ', 'ΣΕΡΠ', 'ΣΚΕΛ', 'ΣΥΡΦ', 'ΤΟΚ', 'Υ', 'Δ', 'ΕΜ', 'ΘΑΡΡ', 'Θ']:&#10; word = word + 'ΕΤ'&#10; else:&#10; for s in ['ΟΔ', 'ΑΙΡ', 'ΦΟΡ', 'ΤΑΘ', 'ΔΙΑΘ', 'ΣΧ', 'ΕΝΔ', 'ΕΥΡ', 'ΤΙΘ', 'ΥΠΕΡΘ', 'ΡΑΘ', 'ΕΝΘ', 'ΡΟΘ', 'ΣΘ', 'ΠΥΡ',&#10; 'ΑΙΝ', 'ΣΥΝΔ', 'ΣΥΝ', 'ΣΥΝΘ', 'ΧΩΡ', 'ΠΟΝ', 'ΒΡ', 'ΚΑΘ', 'ΕΥΘ', 'ΕΚΘ', 'ΝΕΤ', 'ΡΟΝ', 'ΑΡΚ', 'ΒΑΡ', 'ΒΟΛ',&#10; 'ΩΦΕΛ'] + VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΕΤ'&#10; break&#10; done = True&#10;&#10; ##rule-set 10&#10; ##ΑΓΑΠΩΝΤΑΣ-&gt;ΑΓΑΠ, ΞΕΝΟΦΩΝΤΑΣ-&gt;ΞΕΝΟΦΩΝ&#10; if not done:&#10; for suffix in ['ΟΝΤΑΣ', 'ΩΝΤΑΣ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΡΧ']:&#10; word = word + 'ΟΝΤ'&#10; elif word in ['ΞΕΝΟΦ', 'ΚΡΕ']:&#10; word = word + 'ΩΝΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 11&#10; ##ΑΓΑΠΙΟΜΑΣΤΕ-&gt;ΑΓΑΠ, ΟΝΟΜΑΣΤΕ-&gt;ΟΝΟΜΑΣΤ&#10; if not done:&#10; for suffix in ['ΙΟΜΑΣΤΕ', 'ΟΜΑΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΟΝ']:&#10; word = word + 'ΟΜΑΣΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 12&#10; ##ΑΓΑΠΙΕΣΤΕ-&gt;ΑΓΑΠ, ΠΙΕΣΤΕ-&gt;ΠΙΕΣΤ&#10; if not done:&#10; for suffix in ['ΙΕΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Π', 'ΑΠ', 'ΣΥΜΠ', 'ΑΣΥΜΠ', 'ΚΑΤΑΠ', 'ΜΕΤΑΜΦ']:&#10; word = word + 'ΙΕΣΤ'&#10; done = True&#10; break&#10; if not done:&#10; for suffix in ['ΕΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΛ', 'ΑΡ', 'ΕΚΤΕΛ', 'Ζ', 'Μ', 'Ξ', 'ΠΑΡΑΚΑΛ', 'ΑΡ', 'ΠΡΟ', 'ΝΙΣ']:&#10; word = word + 'ΕΣΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 13&#10; ##ΧΤΙΣΤΗΚΕ-&gt;ΧΤΙΣΤ, ΔΙΑΘΗΚΕΣ-&gt;ΔΙΑΘΗΚ&#10; if not done:&#10; for suffix in ['ΗΘΗΚΑ', 'ΗΘΗΚΕΣ', 'ΗΘΗΚΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; done = True&#10; break&#10; if not done:&#10; for suffix in ['ΗΚΑ', 'ΗΚΕΣ', 'ΗΚΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΔΙΑΘ', 'Θ', 'ΠΑΡΑΚΑΤΑΘ', 'ΠΡΟΣΘ', 'ΣΥΝΘ']:&#10; word = word + 'ΗΚ'&#10; else:&#10; for suffix in ['ΣΚΩΛ', 'ΣΚΟΥΛ', 'ΝΑΡΘ', 'ΣΦ', 'ΟΘ', 'ΠΙΘ']:&#10; if ends_with(word, suffix):&#10; word = word + 'ΗΚ'&#10; break&#10; done = True&#10; break&#10; &#10; ##rule-set 14&#10; ##ΧΤΥΠΟΥΣΕΣ-&gt;ΧΤΥΠ, ΜΕΔΟΥΣΕΣ-&gt;ΜΕΔΟΥΣ&#10; if not done:&#10; for suffix in ['ΟΥΣΑ', 'ΟΥΣΕΣ', 'ΟΥΣΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΦΑΡΜΑΚ', 'ΧΑΔ', 'ΑΓΚ', 'ΑΝΑΡΡ', 'ΒΡΟΜ', 'ΕΚΛΙΠ', 'ΛΑΜΠΙΔ', 'ΛΕΧ', 'Μ', 'ΠΑΤ', 'Ρ', 'Λ', 'ΜΕΔ', 'ΜΕΣΑΖ',&#10; 'ΥΠΟΤΕΙΝ', 'ΑΜ', 'ΑΙΘ', 'ΑΝΗΚ', 'ΔΕΣΠΟΖ', 'ΕΝΔΙΑΦΕΡ', 'ΔΕ', 'ΔΕΥΤΕΡΕΥ', 'ΚΑΘΑΡΕΥ', 'ΠΛΕ', 'ΤΣΑ']:&#10; word = word + 'ΟΥΣ'&#10; else:&#10; for s in ['ΠΟΔΑΡ', 'ΒΛΕΠ', 'ΠΑΝΤΑΧ', 'ΦΡΥΔ', 'ΜΑΝΤΙΛ', 'ΜΑΛΛ', 'ΚΥΜΑΤ', 'ΛΑΧ', 'ΛΗΓ', 'ΦΑΓ', 'ΟΜ', 'ΠΡΩΤ'] + VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΟΥΣ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 15&#10; #ΚΟΛΛΑΓΕΣ-&gt;ΚΟΛΛ, ΑΒΑΣΤΑΓΑ-&gt;ΑΒΑΣΤ&#10; if not done:&#10; for suffix in ['ΑΓΑ', 'ΑΓΕΣ', 'ΑΓΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΒΑΣΤ', 'ΠΟΛΥΦ', 'ΑΔΗΦ', 'ΠΑΜΦ', 'Ρ', 'ΑΣΠ', 'ΑΦ', 'ΑΜΑΛ', 'ΑΜΑΛΛΙ', 'ΑΝΥΣΤ', 'ΑΠΕΡ', 'ΑΣΠΑΡ', 'ΑΧΑΡ',&#10; 'ΔΕΡΒΕΝ', 'ΔΡΟΣΟΠ', 'ΞΕΦ', 'ΝΕΟΠ', 'ΝΟΜΟΤ', 'ΟΛΟΠ', 'ΟΜΟΤ', 'ΠΡΟΣΤ', 'ΠΡΟΣΩΠΟΠ', 'ΣΥΜΠ', 'ΣΥΝΤ', 'Τ',&#10; 'ΥΠΟΤ', 'ΧΑΡ', 'ΑΕΙΠ', 'ΑΙΜΟΣΤ', 'ΑΝΥΠ', 'ΑΠΟΤ', 'ΑΡΤΙΠ', 'ΔΙΑΤ', 'ΕΝ', 'ΕΠΙΤ', 'ΚΡΟΚΑΛΟΠ', 'ΣΙΔΗΡΟΠ',&#10; 'Λ', 'ΝΑΥ', 'ΟΥΛΑΜ', 'ΟΥΡ', 'Π', 'ΤΡ', 'Μ']:&#10; word = word + 'ΑΓ'&#10; else:&#10; for s in ['ΟΦ', 'ΠΕΛ', 'ΧΟΡΤ', 'ΣΦ', 'ΡΠ', 'ΦΡ', 'ΠΡ', 'ΛΟΧ', 'ΣΜΗΝ']:&#10; # ΑΦΑΙΡΕΘΗΚΕ: 'ΛΛ'&#10; if ends_with(word, s):&#10; if not word in ['ΨΟΦ', 'ΝΑΥΛΟΧ']:&#10; word = word + 'ΑΓ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 16&#10; ##ΑΓΑΠΗΣΕ-&gt;ΑΓΑΠ, ΝΗΣΟΥ-&gt;ΝΗΣ&#10; if not done:&#10; for suffix in ['ΗΣΕ', 'ΗΣΟΥ', 'ΗΣΑ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Ν', 'ΧΕΡΣΟΝ', 'ΔΩΔΕΚΑΝ', 'ΕΡΗΜΟΝ', 'ΜΕΓΑΛΟΝ', 'ΕΠΤΑΝ', 'ΑΓΑΘΟΝ']:&#10; word = word + 'ΗΣ'&#10; done = True&#10; break&#10; &#10; ##rule-set 17&#10; ##ΑΓΑΠΗΣΤΕ-&gt;ΑΓΑΠ, ΣΒΗΣΤΕ-&gt;ΣΒΗΣΤ&#10; if not done:&#10; for suffix in ['ΗΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΣΒ', 'ΣΒ', 'ΑΧΡ', 'ΧΡ', 'ΑΠΛ', 'ΑΕΙΜΝ', 'ΔΥΣΧΡ', 'ΕΥΧΡ', 'ΚΟΙΝΟΧΡ', 'ΠΑΛΙΜΨ']:&#10; word = word + 'ΗΣΤ'&#10; done = True&#10; break&#10; &#10; ##rule-set 18&#10; ##ΑΓΑΠΟΥΝΕ-&gt;ΑΓΑΠ, ΣΠΙΟΥΝΕ-&gt;ΣΠΙΟΥΝ&#10; if not done:&#10; for suffix in ['ΟΥΝΕ', 'ΗΣΟΥΝΕ', 'ΗΘΟΥΝΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Ν', 'Ρ', 'ΣΠΙ', 'ΣΤΡΑΒΟΜΟΥΤΣ', 'ΚΑΚΟΜΟΥΤΣ', 'ΕΞΩΝ']:&#10; word = word + 'OYN'&#10; done = True&#10; break&#10; &#10; ##rule-set 19&#10; ##ΑΓΑΠΟΥΜΕ-&gt;ΑΓΑΠ, ΦΟΥΜΕ-&gt;ΦΟΥΜ&#10; if not done:&#10; for suffix in ['ΟΥΜΕ', 'ΗΣΟΥΜΕ', 'ΗΘΟΥΜΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΠΑΡΑΣΟΥΣ', 'Φ', 'Χ', 'ΩΡΙΟΠΛ', 'ΑΖ', 'ΑΛΛΟΣΟΥΣ', 'ΑΣΟΥΣ']:&#10; word = word + 'ΟΥΜ'&#10; done = True&#10; break&#10; &#10; ##rule-set 20&#10; ##ΚΥΜΑΤΑ-&gt;ΚΥΜ, ΧΩΡΑΤΟ-&gt;ΧΩΡΑΤ&#10; if not done:&#10; for suffix in ['ΜΑΤΑ', 'ΜΑΤΩΝ', 'ΜΑΤΟΣ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; word = word + 'Μ'&#10; done = True&#10; break&#10; &#10; ##rule-set 21&#10; if not done:&#10; for suffix in ['ΙΟΝΤΟΥΣΑΝ', 'ΙΟΥΜΑΣΤΕ', 'ΙΟΜΑΣΤΑΝ', 'ΙΟΣΑΣΤΑΝ', 'ΟΝΤΟΥΣΑΝ', 'ΙΟΣΑΣΤΕ', 'ΙΕΜΑΣΤΕ', 'ΙΕΣΑΣΤΕ', 'ΙΟΜΟΥΝΑ',&#10; 'ΙΟΣΟΥΝΑ', 'ΙΟΥΝΤΑΙ', 'ΙΟΥΝΤΑΝ', 'ΗΘΗΚΑΤΕ', 'ΟΜΑΣΤΑΝ', 'ΟΣΑΣΤΑΝ', 'ΟΥΜΑΣΤΕ', 'ΙΟΜΟΥΝ', 'ΙΟΝΤΑΝ', 'ΙΟΣΟΥΝ',&#10; 'ΗΘΕΙΤΕ', 'ΗΘΗΚΑΝ', 'ΟΜΟΥΝΑ', 'ΟΣΑΣΤΕ', 'ΟΣΟΥΝΑ', 'ΟΥΝΤΑΙ', 'ΟΥΝΤΑΝ', 'ΟΥΣΑΤΕ', 'ΑΓΑΤΕ', 'ΕΙΤΑΙ', 'ΙΕΜΑΙ',&#10; 'ΙΕΤΑΙ', 'ΙΕΣΑΙ', 'ΙΟΤΑΝ', 'ΙΟΥΜΑ', 'ΗΘΕΙΣ', 'ΗΘΟΥΝ', 'ΗΚΑΤΕ', 'ΗΣΑΤΕ', 'ΗΣΟΥΝ', 'ΟΜΟΥΝ', 'ΟΝΤΑΙ',&#10; 'ΟΝΤΑΝ', 'ΟΣΟΥΝ', 'ΟΥΜΑΙ', 'ΟΥΣΑΝ', 'ΑΓΑΝ', 'ΑΜΑΙ', 'ΑΣΑΙ', 'ΑΤΑΙ', 'ΕΙΤΕ', 'ΕΣΑΙ', 'ΕΤΑΙ', 'ΗΔΕΣ',&#10; 'ΗΔΩΝ', 'ΗΘΕΙ', 'ΗΚΑΝ', 'ΗΣΑΝ', 'ΗΣΕΙ', 'ΗΣΕΣ', 'ΟΜΑΙ', 'ΟΤΑΝ', 'ΑΕΙ', 'ΕΙΣ', 'ΗΘΩ', 'ΗΣΩ', 'ΟΥΝ',&#10; 'ΟΥΣ', 'ΑΝ', 'ΑΣ', 'ΑΩ', 'ΕΙ', 'ΕΣ', 'ΗΣ', 'ΟΙ', 'ΟΝ', 'ΟΣ', 'ΟΥ', 'ΥΣ', 'ΩΝ', 'ΩΣ', 'Α', 'Ε', 'Ι', 'Η',&#10; 'Ο', 'Υ', 'Ω']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; break&#10;&#10; ##rule-set 22&#10; ##ΠΛΗΣΙΕΣΤΑΤΟΣ-&gt;ΠΛΥΣΙ, ΜΕΓΑΛΥΤΕΡΗ-&gt;ΜΕΓΑΛ, ΚΟΝΤΟΤΕΡΟ-&gt;ΚΟΝΤ&#10; if not done:&#10; for suffix in ['ΕΣΤΕΡ', 'ΕΣΤΑΤ', 'ΟΤΕΡ', 'ΟΤΑΤ', 'ΥΤΕΡ', 'ΥΤΑΤ', 'ΩΤΕΡ', 'ΩΤΑΤ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; break&#10; &#10; return word"/>
    </operator>
    <connect from_op="editing of words" from_port="out 1" to_port="result 1"/>
    <connect from_op="editing of words" from_port="out 2" to_op="Execute Python" to_port="input 1"/>
    <connect from_op="Execute Python" from_port="output 1" to_port="result 2"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    <portSpacing port="sink_result 3" spacing="0"/>
    </process>
    </operator>
    </process>
  • ckouts03ckouts03 Member Posts: 4 Contributor I

    guys I have a problem. Displaying Memory buffered file. Why? what shall I do?

    <?xml version="1.0" encoding="UTF-8"?><process version="8.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="8.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="subprocess" compatibility="8.2.001" expanded="true" height="82" name="editing of words" width="90" x="112" y="85">
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="8.2.001" expanded="true" height="68" name="Retrieve Book42 (2)" width="90" x="45" y="34">
    <parameter key="repository_entry" value="//Local Repository/data/Book42"/>
    </operator>
    <operator activated="true" class="nominal_to_text" compatibility="8.2.001" expanded="true" height="82" name="Nominal to Text (3)" width="90" x="179" y="34"/>
    <operator activated="true" class="text:process_document_from_data" compatibility="8.1.000" expanded="true" height="82" name="Process Documents from Data (3)" width="90" x="313" y="34">
    <parameter key="keep_text" value="true"/>
    <parameter key="prune_method" value="percentual"/>
    <parameter key="prune_below_percent" value="1.0"/>
    <parameter key="prune_above_percent" value="100.0"/>
    <list key="specify_weights"/>
    <process expanded="true">
    <operator activated="true" class="text:transform_cases" compatibility="8.1.000" expanded="true" height="68" name="Transform Cases (3)" width="90" x="45" y="34"/>
    <operator activated="true" class="text:tokenize" compatibility="8.1.000" expanded="true" height="68" name="Tokenize (3)" width="90" x="179" y="34"/>
    <operator activated="true" class="text:filter_by_length" compatibility="8.1.000" expanded="true" height="68" name="Filter Tokens (2)" width="90" x="313" y="34">
    <parameter key="min_chars" value="2"/>
    <parameter key="max_chars" value="30"/>
    </operator>
    <operator activated="true" class="text:filter_stopwords_dictionary" compatibility="8.1.000" expanded="true" height="82" name="Filter Stopwords (2)" width="90" x="447" y="34">
    <parameter key="file" value="C:\Users\chrysk\Documents\job\Virkia\greekstopwords.txt"/>
    </operator>
    <operator activated="true" class="text:replace_tokens" compatibility="8.1.000" expanded="true" height="68" name="Replace Tokens (2)" width="90" x="581" y="34">
    <list key="replace_dictionary">
    <parameter key="ά" value="α"/>
    <parameter key="έ" value="ε"/>
    <parameter key="ή" value="η"/>
    <parameter key="ό" value="ο"/>
    <parameter key="ί" value="ι"/>
    <parameter key="ύ" value="υ"/>
    <parameter key="ώ" value="ω"/>
    <parameter key="ΐ" value="ϊ"/>
    <parameter key="ΰ" value="ϋ"/>
    </list>
    </operator>
    <operator activated="true" class="text:transform_cases" compatibility="8.1.000" expanded="true" height="68" name="Transform Cases (4)" width="90" x="581" y="187">
    <parameter key="transform_to" value="upper case"/>
    </operator>
    <connect from_port="document" to_op="Transform Cases (3)" to_port="document"/>
    <connect from_op="Transform Cases (3)" from_port="document" to_op="Tokenize (3)" to_port="document"/>
    <connect from_op="Tokenize (3)" from_port="document" to_op="Filter Tokens (2)" to_port="document"/>
    <connect from_op="Filter Tokens (2)" from_port="document" to_op="Filter Stopwords (2)" to_port="document"/>
    <connect from_op="Filter Stopwords (2)" from_port="document" to_op="Replace Tokens (2)" to_port="document"/>
    <connect from_op="Replace Tokens (2)" from_port="document" to_op="Transform Cases (4)" to_port="document"/>
    <connect from_op="Transform Cases (4)" from_port="document" to_port="document 1"/>
    <portSpacing port="source_document" spacing="0"/>
    <portSpacing port="sink_document 1" spacing="0"/>
    <portSpacing port="sink_document 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="text:wordlist_to_data" compatibility="8.1.000" expanded="true" height="82" name="WordList to Data (2)" width="90" x="447" y="34"/>
    <operator activated="true" class="select_attributes" compatibility="8.2.001" expanded="true" height="82" name="Select Attributes (2)" width="90" x="581" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="word"/>
    </operator>
    <operator activated="true" class="nominal_to_text" compatibility="8.2.001" expanded="true" height="82" name="Nominal to Text (4)" width="90" x="715" y="34"/>
    <connect from_op="Retrieve Book42 (2)" from_port="output" to_op="Nominal to Text (3)" to_port="example set input"/>
    <connect from_op="Nominal to Text (3)" from_port="example set output" to_op="Process Documents from Data (3)" to_port="example set"/>
    <connect from_op="Process Documents from Data (3)" from_port="word list" to_op="WordList to Data (2)" to_port="word list"/>
    <connect from_op="WordList to Data (2)" from_port="example set" to_op="Select Attributes (2)" to_port="example set input"/>
    <connect from_op="Select Attributes (2)" from_port="example set output" to_op="Nominal to Text (4)" to_port="example set input"/>
    <connect from_op="Nominal to Text (4)" from_port="example set output" to_port="out 1"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="python_scripting:execute_python" compatibility="7.4.000" expanded="true" height="82" name="Execute Python" width="90" x="313" y="85">
    <parameter key="script" value="# -*- coding: cp1253 -*-&#10;import pandas&#10;&#10;##Ελληνικό Ανοιχτό Πανεπιστήμιο - Πρόγραμμα Σπουδών Πληροφορικής&#10;##Πτυχιακή Εργασία: HOU-CS-UGP-2013-18&#10;##&quot;Αλγόριθμοι Αποδοτικής Επιλογής Χαρακτηριστικών για Κατηγοριοποίηση Κειμένου στην Ελληνική Γλώσσα&quot;&#10;##Αλέξανδρος Καλαπόδης&#10;##Επιβλέπων Καθηγητής: Σπύρος Λυκοθανάσης, Τμήμα Μηχανικών Η/Υ &amp; Πληροφορικής, Πανεπιστήμιο Πάτρας&#10;&#10;##Implementation in Python of the greek stemmer presented by Giorgios Ntais during his master thesis with title&#10;##&quot;Development of a Stemmer for the Greek Language&quot; in the Department of Computer and Systems Sciences&#10;##at Stockholm's University / Royal Institute of Technology.&#10;&#10;##The system takes as input a word and removes its inflexional suffix according to a rule based algorithm.&#10;##The algorithm follows the known Porter algorithm for the English language and it is developed according to the&#10;##grammatical rules of the Modern Greek language.&#10;&#10;def rm_main(data):&#10; VOWELS = ['Α', 'Ε', 'Η', 'Ι', 'Ο', 'Υ', 'Ω', '’', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ', 'Ϊ', 'Ϋ']&#10;&#10; def ends_with(word, suffix):&#10; return word[len(word) - len(suffix):] == suffix&#10;&#10; def stem(word):&#10; done = len(word) &lt;= 3&#10;&#10; ##rule-set 1&#10; ##ΓΙΑΓΙΑΔΕΣ-&gt;ΓΙΑΓ, ΟΜΑΔΕΣ-&gt;ΟΜΑΔ&#10; if not done:&#10; for suffix in ['ΙΑΔΕΣ', 'ΑΔΕΣ', 'ΑΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; remaining_part_does_not_end_on = True&#10; for s in ['ΟΚ', 'ΜΑΜ', 'ΜΑΝ', 'ΜΠΑΜΠ', 'ΠΑΤΕΡ', 'ΓΙΑΓ', 'ΝΤΑΝΤ', 'ΚΥΡ', 'ΘΕΙ', 'ΠΕΘΕΡ']:&#10; if ends_with(word, s):&#10; remaining_part_does_not_end_on = False&#10; break&#10; if remaining_part_does_not_end_on:&#10; word = word + 'ΑΔ'&#10; done = True&#10; break&#10;&#10; ##rule-set 2&#10; ##ΚΑΦΕΔΕΣ-&gt;ΚΑΦ, ΓΗΠΕΔΩΝ-&gt;ΓΗΠΕΔ&#10; if not done:&#10; for suffix in ['ΕΔΕΣ', 'ΕΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['ΟΠ', 'ΙΠ', 'ΕΜΠ', 'ΥΠ', 'ΓΗΠ', 'ΔΑΠ', 'ΚΡΑΣΠ', 'ΜΙΛ']:&#10; if ends_with(word, s):&#10; word = word + 'ΕΔ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 3&#10; ##ΠΑΠΠΟΥΔΩΝ-&gt;ΠΑΠΠ, ΑΡΚΟΥΔΕΣ-&gt;ΑΡΚΟΥΔ&#10; if not done:&#10; for suffix in ['ΟΥΔΕΣ', 'ΟΥΔΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['ΑΡΚ', 'ΚΑΛΙΑΚ', 'ΠΕΤΑΛ', 'ΛΙΧ', 'ΠΛΕΞ', 'ΣΚ', 'Σ', 'ΦΛ', 'ΦΡ', 'ΒΕΛ', 'ΛΟΥΛ', 'ΧΝ', 'ΣΠ',&#10; 'ΤΡΑΓ', 'ΦΕ']:&#10; if ends_with(word, s):&#10; word = word + 'ΟΥΔ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 4&#10; ##ΥΠΟΘΕΣΕΩΣ-&gt;ΥΠΟΘΕΣ, ΘΕΩΝ-&gt;ΘΕ&#10; if not done:&#10; for suffix in ['ΕΩΣ', 'ΕΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in ['Θ', 'Δ', 'ΕΛ', 'ΓΑΛ', 'Ν', 'Π', 'ΙΔ', 'ΠΑΡ']:&#10; if ends_with(word, s):&#10; word = word + 'Ε'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 5&#10; ##ΠΑΙΔΙΑ-&gt;ΠΑΙΔ, ΤΕΛΕΙΟΥ-&gt;ΤΕΛΕΙ&#10; if not done:&#10; for suffix in ['ΙΑ', 'ΙΟΥ', 'ΙΩΝ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'Ι'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 6&#10; ##ΖΗΛΙΑΡΙΚΟ-&gt;ΖΗΛΙΑΡ, ΑΓΡΟΙΚΟΣ-&gt;ΑΓΡΟΙΚ&#10; if not done:&#10; for suffix in ['ΙΚΑ', 'ΙΚΟΥ', 'ΙΚΩΝ', 'ΙΚΟΣ', 'ΙΚΟ', 'ΙΚΗ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΛ', 'ΑΔ', 'ΕΝΔ', 'ΑΜΑΝ', 'ΑΜΜΟΧΑΛ', 'ΗΘ', 'ΑΝΗΘ', 'ΑΝΤΙΔ', 'ΦΥΣ', 'ΒΡΩΜ', 'ΓΕΡ',&#10; 'ΕΞΩΔ',&#10; 'ΚΑΛΠ',&#10; 'ΚΑΛΛΙΝ', 'ΚΑΤΑΔ', 'ΜΟΥΛ', 'ΜΠΑΝ', 'ΜΠΑΓΙΑΤ', 'ΜΠΟΛ', 'ΜΠΟΣ', 'ΝΙΤ', 'ΞΙΚ', 'ΣΥΝΟΜΗΛ',&#10; 'ΠΕΤΣ', 'ΠΙΤΣ',&#10; 'ΠΙΚΑΝΤ', 'ΠΛΙΑΤΣ', 'ΠΟΝΤ', 'ΠΟΣΤΕΛΝ', 'ΠΡΩΤΟΔ', 'ΣΕΡΤ', 'ΣΥΝΑΔ', 'ΤΣΑΜ', 'ΥΠΟΔ',&#10; 'ΦΙΛΟΝ',&#10; 'ΦΥΛΟΔ',&#10; 'ΧΑΣ']:&#10; word = word + 'ΙΚ'&#10; else:&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΙΚ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 7&#10; ##ΑΓΑΠΑΓΑΜΕ-&gt;ΑΓΑΠ, ΑΝΑΠΑΜΕ-&gt;ΑΝΑΠΑΜ&#10; if not done:&#10; if word == 'ΑΓΑΜΕ': word = 2 * word&#10; for suffix in ['ΗΘΗΚΑΜΕ', 'ΑΓΑΜΕ', 'ΗΣΑΜΕ', 'ΟΥΣΑΜΕ', 'ΗΚΑΜΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Φ']:&#10; word = word + 'ΑΓΑΜ'&#10; done = True&#10; break&#10; if not done and ends_with(word, 'ΑΜΕ'):&#10; word = word[:len(word) - len('ΑΜΕ')]&#10; if word in ['ΑΝΑΠ', 'ΑΠΟΘ', 'ΑΠΟΚ', 'ΑΠΟΣΤ', 'ΒΟΥΒ', 'ΞΕΘ', 'ΟΥΛ', 'ΠΕΘ', 'ΠΙΚΡ', 'ΠΟΤ', 'ΣΙΧ', 'Χ']:&#10; word = word + 'ΑΜ'&#10; done = True&#10;&#10; ##rule-set 8&#10; ##ΑΓΑΠΗΣΑΜΕ-&gt;ΑΓΑΠ, ΤΡΑΓΑΝΕ-&gt;ΤΡΑΓΑΝ&#10; if not done:&#10; for suffix in ['ΙΟΥΝΤΑΝΕ', 'ΙΟΝΤΑΝΕ', 'ΟΥΝΤΑΝΕ', 'ΗΘΗΚΑΝΕ', 'ΟΥΣΑΝΕ', 'ΙΟΤΑΝΕ', 'ΟΝΤΑΝΕ', 'ΑΓΑΝΕ', 'ΗΣΑΝΕ',&#10; 'ΟΤΑΝΕ', 'ΗΚΑΝΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΤΡ', 'ΤΣ', 'Φ']:&#10; word = word + 'ΑΓΑΝ'&#10; done = True&#10; break&#10; if not done and ends_with(word, 'ΑΝΕ'):&#10; word = word[:len(word) - len('ΑΜΕ')]&#10; if word in ['ΒΕΤΕΡ', 'ΒΟΥΛΚ', 'ΒΡΑΧΜ', 'Γ', 'ΔΡΑΔΟΥΜ', 'Θ', 'ΚΑΛΠΟΥΖ', 'ΚΑΣΤΕΛ', 'ΚΟΡΜΟΡ', 'ΛΑΟΠΛ',&#10; 'ΜΩΑΜΕΘ', 'Μ',&#10; 'ΜΟΥΣΟΥΛΜ', 'Ν', 'ΟΥΛ', 'Π', 'ΠΕΛΕΚ', 'ΠΛ', 'ΠΟΛΙΣ', 'ΠΟΡΤΟΛ', 'ΣΑΡΑΚΑΤΣ', 'ΣΟΥΛΤ',&#10; 'ΤΣΑΡΛΑΤ',&#10; 'ΟΡΦ',&#10; 'ΤΣΙΓΓ', 'ΤΣΟΠ', 'ΦΩΤΟΣΤΕΦ', 'Χ', 'ΨΥΧΟΠΛ', 'ΑΓ', 'ΟΡΦ', 'ΓΑΛ', 'ΓΕΡ', 'ΔΕΚ', 'ΔΙΠΛ',&#10; 'ΑΜΕΡΙΚΑΝ', 'ΟΥΡ',&#10; 'ΠΙΘ', 'ΠΟΥΡΙΤ', 'Σ', 'ΖΩΝΤ', 'ΙΚ', 'ΚΑΣΤ', 'ΚΟΠ', 'ΛΙΧ', 'ΛΟΥΘΗΡ', 'ΜΑΙΝΤ', 'ΜΕΛ', 'ΣΙΓ',&#10; 'ΣΠ',&#10; 'ΣΤΕΓ',&#10; 'ΤΡΑΓ', 'ΤΣΑΓ', 'Φ', 'ΕΡ', 'ΑΔΑΠ', 'ΑΘΙΓΓ', 'ΑΜΗΧ', 'ΑΝΙΚ', 'ΑΝΟΡΓ', 'ΑΠΗΓ', 'ΑΠΙΘ',&#10; 'ΑΤΣΙΓΓ',&#10; 'ΒΑΣ',&#10; 'ΒΑΣΚ', 'ΒΑΘΥΓΑΛ', 'ΒΙΟΜΗΧ', 'ΒΡΑΧΥΚ', 'ΔΙΑΤ', 'ΔΙΑΦ', 'ΕΝΟΡΓ', 'ΘΥΣ', 'ΚΑΠΝΟΒΙΟΜΗΧ',&#10; 'ΚΑΤΑΓΑΛ',&#10; 'ΚΛΙΒ',&#10; 'ΚΟΙΛΑΡΦ', 'ΛΙΒ', 'ΜΕΓΛΟΒΙΟΜΗΧ', 'ΜΙΚΡΟΒΙΟΜΗΧ', 'ΝΤΑΒ', 'ΞΗΡΟΚΛΙΒ', 'ΟΛΙΓΟΔΑΜ', 'ΟΛΟΓΑΛ',&#10; 'ΠΕΝΤΑΡΦ',&#10; 'ΠΕΡΗΦ', 'ΠΕΡΙΤΡ', 'ΠΛΑΤ', 'ΠΟΛΥΔΑΠ', 'ΠΟΛΥΜΗΧ', 'ΣΤΕΦ', 'ΤΑΒ', 'ΤΕΤ', 'ΥΠΕΡΗΦ', 'ΥΠΟΚΟΠ',&#10; 'ΧΑΜΗΛΟΔΑΠ',&#10; 'ΨΗΛΟΤΑΒ']:&#10; word = word + 'ΑΝ'&#10; else:&#10; for s in VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΑΝ'&#10; break&#10; done = True&#10;&#10; ##rule-set 9&#10; ##ΑΓΑΠΗΣΕΤΕ-&gt;ΑΓΑΠ, ΒΕΝΕΤΕ-&gt;ΒΕΝΕΤ&#10; if not done:&#10; if ends_with(word, 'ΗΣΕΤΕ'):&#10; word = word[:len(word) - len('ΗΣΕΤΕ')]&#10; done = True&#10; elif ends_with(word, 'ΕΤΕ'):&#10; word = word[:len(word) - len('ΕΤΕ')]&#10; if word in ['ΑΒΑΡ', 'ΒΕΝ', 'ΕΝΑΡ', 'ΑΒΡ', 'ΑΔ', 'ΑΘ', 'ΑΝ', 'ΑΠΛ', 'ΒΑΡΟΝ', 'ΝΤΡ', 'ΣΚ', 'ΚΟΠ', 'ΜΠΟΡ',&#10; 'ΝΙΦ', 'ΠΑΓ',&#10; 'ΠΑΡΑΚΑΛ', 'ΣΕΡΠ', 'ΣΚΕΛ', 'ΣΥΡΦ', 'ΤΟΚ', 'Υ', 'Δ', 'ΕΜ', 'ΘΑΡΡ', 'Θ']:&#10; word = word + 'ΕΤ'&#10; else:&#10; for s in ['ΟΔ', 'ΑΙΡ', 'ΦΟΡ', 'ΤΑΘ', 'ΔΙΑΘ', 'ΣΧ', 'ΕΝΔ', 'ΕΥΡ', 'ΤΙΘ', 'ΥΠΕΡΘ', 'ΡΑΘ', 'ΕΝΘ',&#10; 'ΡΟΘ',&#10; 'ΣΘ', 'ΠΥΡ',&#10; 'ΑΙΝ', 'ΣΥΝΔ', 'ΣΥΝ', 'ΣΥΝΘ', 'ΧΩΡ', 'ΠΟΝ', 'ΒΡ', 'ΚΑΘ', 'ΕΥΘ', 'ΕΚΘ', 'ΝΕΤ', 'ΡΟΝ',&#10; 'ΑΡΚ',&#10; 'ΒΑΡ', 'ΒΟΛ',&#10; 'ΩΦΕΛ'] + VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΕΤ'&#10; break&#10; done = True&#10;&#10; ##rule-set 10&#10; ##ΑΓΑΠΩΝΤΑΣ-&gt;ΑΓΑΠ, ΞΕΝΟΦΩΝΤΑΣ-&gt;ΞΕΝΟΦΩΝ&#10; if not done:&#10; for suffix in ['ΟΝΤΑΣ', 'ΩΝΤΑΣ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΡΧ']:&#10; word = word + 'ΟΝΤ'&#10; elif word in ['ΞΕΝΟΦ', 'ΚΡΕ']:&#10; word = word + 'ΩΝΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 11&#10; ##ΑΓΑΠΙΟΜΑΣΤΕ-&gt;ΑΓΑΠ, ΟΝΟΜΑΣΤΕ-&gt;ΟΝΟΜΑΣΤ&#10; if not done:&#10; for suffix in ['ΙΟΜΑΣΤΕ', 'ΟΜΑΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΟΝ']:&#10; word = word + 'ΟΜΑΣΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 12&#10; ##ΑΓΑΠΙΕΣΤΕ-&gt;ΑΓΑΠ, ΠΙΕΣΤΕ-&gt;ΠΙΕΣΤ&#10; if not done:&#10; for suffix in ['ΙΕΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Π', 'ΑΠ', 'ΣΥΜΠ', 'ΑΣΥΜΠ', 'ΚΑΤΑΠ', 'ΜΕΤΑΜΦ']:&#10; word = word + 'ΙΕΣΤ'&#10; done = True&#10; break&#10; if not done:&#10; for suffix in ['ΕΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΛ', 'ΑΡ', 'ΕΚΤΕΛ', 'Ζ', 'Μ', 'Ξ', 'ΠΑΡΑΚΑΛ', 'ΑΡ', 'ΠΡΟ', 'ΝΙΣ']:&#10; word = word + 'ΕΣΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 13&#10; ##ΧΤΙΣΤΗΚΕ-&gt;ΧΤΙΣΤ, ΔΙΑΘΗΚΕΣ-&gt;ΔΙΑΘΗΚ&#10; if not done:&#10; for suffix in ['ΗΘΗΚΑ', 'ΗΘΗΚΕΣ', 'ΗΘΗΚΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; done = True&#10; break&#10; if not done:&#10; for suffix in ['ΗΚΑ', 'ΗΚΕΣ', 'ΗΚΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΔΙΑΘ', 'Θ', 'ΠΑΡΑΚΑΤΑΘ', 'ΠΡΟΣΘ', 'ΣΥΝΘ']:&#10; word = word + 'ΗΚ'&#10; else:&#10; for suffix in ['ΣΚΩΛ', 'ΣΚΟΥΛ', 'ΝΑΡΘ', 'ΣΦ', 'ΟΘ', 'ΠΙΘ']:&#10; if ends_with(word, suffix):&#10; word = word + 'ΗΚ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 14&#10; ##ΧΤΥΠΟΥΣΕΣ-&gt;ΧΤΥΠ, ΜΕΔΟΥΣΕΣ-&gt;ΜΕΔΟΥΣ&#10; if not done:&#10; for suffix in ['ΟΥΣΑ', 'ΟΥΣΕΣ', 'ΟΥΣΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΦΑΡΜΑΚ', 'ΧΑΔ', 'ΑΓΚ', 'ΑΝΑΡΡ', 'ΒΡΟΜ', 'ΕΚΛΙΠ', 'ΛΑΜΠΙΔ', 'ΛΕΧ', 'Μ', 'ΠΑΤ', 'Ρ', 'Λ',&#10; 'ΜΕΔ', 'ΜΕΣΑΖ',&#10; 'ΥΠΟΤΕΙΝ', 'ΑΜ', 'ΑΙΘ', 'ΑΝΗΚ', 'ΔΕΣΠΟΖ', 'ΕΝΔΙΑΦΕΡ', 'ΔΕ', 'ΔΕΥΤΕΡΕΥ', 'ΚΑΘΑΡΕΥ',&#10; 'ΠΛΕ',&#10; 'ΤΣΑ']:&#10; word = word + 'ΟΥΣ'&#10; else:&#10; for s in ['ΠΟΔΑΡ', 'ΒΛΕΠ', 'ΠΑΝΤΑΧ', 'ΦΡΥΔ', 'ΜΑΝΤΙΛ', 'ΜΑΛΛ', 'ΚΥΜΑΤ', 'ΛΑΧ', 'ΛΗΓ', 'ΦΑΓ',&#10; 'ΟΜ',&#10; 'ΠΡΩΤ'] + VOWELS:&#10; if ends_with(word, s):&#10; word = word + 'ΟΥΣ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 15&#10; # ΚΟΛΛΑΓΕΣ-&gt;ΚΟΛΛ, ΑΒΑΣΤΑΓΑ-&gt;ΑΒΑΣΤ&#10; if not done:&#10; for suffix in ['ΑΓΑ', 'ΑΓΕΣ', 'ΑΓΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΒΑΣΤ', 'ΠΟΛΥΦ', 'ΑΔΗΦ', 'ΠΑΜΦ', 'Ρ', 'ΑΣΠ', 'ΑΦ', 'ΑΜΑΛ', 'ΑΜΑΛΛΙ', 'ΑΝΥΣΤ', 'ΑΠΕΡ',&#10; 'ΑΣΠΑΡ', 'ΑΧΑΡ',&#10; 'ΔΕΡΒΕΝ', 'ΔΡΟΣΟΠ', 'ΞΕΦ', 'ΝΕΟΠ', 'ΝΟΜΟΤ', 'ΟΛΟΠ', 'ΟΜΟΤ', 'ΠΡΟΣΤ', 'ΠΡΟΣΩΠΟΠ', 'ΣΥΜΠ',&#10; 'ΣΥΝΤ', 'Τ',&#10; 'ΥΠΟΤ', 'ΧΑΡ', 'ΑΕΙΠ', 'ΑΙΜΟΣΤ', 'ΑΝΥΠ', 'ΑΠΟΤ', 'ΑΡΤΙΠ', 'ΔΙΑΤ', 'ΕΝ', 'ΕΠΙΤ',&#10; 'ΚΡΟΚΑΛΟΠ',&#10; 'ΣΙΔΗΡΟΠ',&#10; 'Λ', 'ΝΑΥ', 'ΟΥΛΑΜ', 'ΟΥΡ', 'Π', 'ΤΡ', 'Μ']:&#10; word = word + 'ΑΓ'&#10; else:&#10; for s in ['ΟΦ', 'ΠΕΛ', 'ΧΟΡΤ', 'ΣΦ', 'ΡΠ', 'ΦΡ', 'ΠΡ', 'ΛΟΧ', 'ΣΜΗΝ']:&#10; # ΑΦΑΙΡΕΘΗΚΕ: 'ΛΛ'&#10; if ends_with(word, s):&#10; if not word in ['ΨΟΦ', 'ΝΑΥΛΟΧ']:&#10; word = word + 'ΑΓ'&#10; break&#10; done = True&#10; break&#10;&#10; ##rule-set 16&#10; ##ΑΓΑΠΗΣΕ-&gt;ΑΓΑΠ, ΝΗΣΟΥ-&gt;ΝΗΣ&#10; if not done:&#10; for suffix in ['ΗΣΕ', 'ΗΣΟΥ', 'ΗΣΑ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Ν', 'ΧΕΡΣΟΝ', 'ΔΩΔΕΚΑΝ', 'ΕΡΗΜΟΝ', 'ΜΕΓΑΛΟΝ', 'ΕΠΤΑΝ', 'ΑΓΑΘΟΝ']:&#10; word = word + 'ΗΣ'&#10; done = True&#10; break&#10;&#10; ##rule-set 17&#10; ##ΑΓΑΠΗΣΤΕ-&gt;ΑΓΑΠ, ΣΒΗΣΤΕ-&gt;ΣΒΗΣΤ&#10; if not done:&#10; for suffix in ['ΗΣΤΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΑΣΒ', 'ΣΒ', 'ΑΧΡ', 'ΧΡ', 'ΑΠΛ', 'ΑΕΙΜΝ', 'ΔΥΣΧΡ', 'ΕΥΧΡ', 'ΚΟΙΝΟΧΡ', 'ΠΑΛΙΜΨ']:&#10; word = word + 'ΗΣΤ'&#10; done = True&#10; break&#10;&#10; ##rule-set 18&#10; ##ΑΓΑΠΟΥΝΕ-&gt;ΑΓΑΠ, ΣΠΙΟΥΝΕ-&gt;ΣΠΙΟΥΝ&#10; if not done:&#10; for suffix in ['ΟΥΝΕ', 'ΗΣΟΥΝΕ', 'ΗΘΟΥΝΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['Ν', 'Ρ', 'ΣΠΙ', 'ΣΤΡΑΒΟΜΟΥΤΣ', 'ΚΑΚΟΜΟΥΤΣ', 'ΕΞΩΝ']:&#10; word = word + 'OYN'&#10; done = True&#10; break&#10;&#10; ##rule-set 19&#10; ##ΑΓΑΠΟΥΜΕ-&gt;ΑΓΑΠ, ΦΟΥΜΕ-&gt;ΦΟΥΜ&#10; if not done:&#10; for suffix in ['ΟΥΜΕ', 'ΗΣΟΥΜΕ', 'ΗΘΟΥΜΕ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; if word in ['ΠΑΡΑΣΟΥΣ', 'Φ', 'Χ', 'ΩΡΙΟΠΛ', 'ΑΖ', 'ΑΛΛΟΣΟΥΣ', 'ΑΣΟΥΣ']:&#10; word = word + 'ΟΥΜ'&#10; done = True&#10; break&#10;&#10; ##rule-set 20&#10; ##ΚΥΜΑΤΑ-&gt;ΚΥΜ, ΧΩΡΑΤΟ-&gt;ΧΩΡΑΤ&#10; if not done:&#10; for suffix in ['ΜΑΤΑ', 'ΜΑΤΩΝ', 'ΜΑΤΟΣ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; word = word + 'Μ'&#10; done = True&#10; break&#10;&#10; ##rule-set 21&#10; if not done:&#10; for suffix in ['ΙΟΝΤΟΥΣΑΝ', 'ΙΟΥΜΑΣΤΕ', 'ΙΟΜΑΣΤΑΝ', 'ΙΟΣΑΣΤΑΝ', 'ΟΝΤΟΥΣΑΝ', 'ΙΟΣΑΣΤΕ', 'ΙΕΜΑΣΤΕ', 'ΙΕΣΑΣΤΕ',&#10; 'ΙΟΜΟΥΝΑ',&#10; 'ΙΟΣΟΥΝΑ', 'ΙΟΥΝΤΑΙ', 'ΙΟΥΝΤΑΝ', 'ΗΘΗΚΑΤΕ', 'ΟΜΑΣΤΑΝ', 'ΟΣΑΣΤΑΝ', 'ΟΥΜΑΣΤΕ', 'ΙΟΜΟΥΝ',&#10; 'ΙΟΝΤΑΝ',&#10; 'ΙΟΣΟΥΝ',&#10; 'ΗΘΕΙΤΕ', 'ΗΘΗΚΑΝ', 'ΟΜΟΥΝΑ', 'ΟΣΑΣΤΕ', 'ΟΣΟΥΝΑ', 'ΟΥΝΤΑΙ', 'ΟΥΝΤΑΝ', 'ΟΥΣΑΤΕ', 'ΑΓΑΤΕ',&#10; 'ΕΙΤΑΙ',&#10; 'ΙΕΜΑΙ',&#10; 'ΙΕΤΑΙ', 'ΙΕΣΑΙ', 'ΙΟΤΑΝ', 'ΙΟΥΜΑ', 'ΗΘΕΙΣ', 'ΗΘΟΥΝ', 'ΗΚΑΤΕ', 'ΗΣΑΤΕ', 'ΗΣΟΥΝ', 'ΟΜΟΥΝ',&#10; 'ΟΝΤΑΙ',&#10; 'ΟΝΤΑΝ', 'ΟΣΟΥΝ', 'ΟΥΜΑΙ', 'ΟΥΣΑΝ', 'ΑΓΑΝ', 'ΑΜΑΙ', 'ΑΣΑΙ', 'ΑΤΑΙ', 'ΕΙΤΕ', 'ΕΣΑΙ', 'ΕΤΑΙ',&#10; 'ΗΔΕΣ',&#10; 'ΗΔΩΝ', 'ΗΘΕΙ', 'ΗΚΑΝ', 'ΗΣΑΝ', 'ΗΣΕΙ', 'ΗΣΕΣ', 'ΟΜΑΙ', 'ΟΤΑΝ', 'ΑΕΙ', 'ΕΙΣ', 'ΗΘΩ', 'ΗΣΩ',&#10; 'ΟΥΝ',&#10; 'ΟΥΣ', 'ΑΝ', 'ΑΣ', 'ΑΩ', 'ΕΙ', 'ΕΣ', 'ΗΣ', 'ΟΙ', 'ΟΝ', 'ΟΣ', 'ΟΥ', 'ΥΣ', 'ΩΝ', 'ΩΣ', 'Α',&#10; 'Ε',&#10; 'Ι', 'Η',&#10; 'Ο', 'Υ', 'Ω']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; break&#10;&#10; ##rule-set 22&#10; ##ΠΛΗΣΙΕΣΤΑΤΟΣ-&gt;ΠΛΥΣΙ, ΜΕΓΑΛΥΤΕΡΗ-&gt;ΜΕΓΑΛ, ΚΟΝΤΟΤΕΡΟ-&gt;ΚΟΝΤ&#10; if not done:&#10; for suffix in ['ΕΣΤΕΡ', 'ΕΣΤΑΤ', 'ΟΤΕΡ', 'ΟΤΑΤ', 'ΥΤΕΡ', 'ΥΤΑΤ', 'ΩΤΕΡ', 'ΩΤΑΤ']:&#10; if ends_with(word, suffix):&#10; word = word[:len(word) - len(suffix)]&#10; break&#10;&#10; return word&#10; i = 0&#10; lista = []&#10; for x in data:&#10; stema = stem(x)&#10; lista.append(stema)&#10; i = i + 1&#10; print(lista)&#10; data = lista&#10; return data"/>
    </operator>
    <connect from_op="editing of words" from_port="out 1" to_op="Execute Python" to_port="input 1"/>
    <connect from_op="Execute Python" from_port="output 1" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>
Sign In or Register to comment.