Skip to content

Instantly share code, notes, and snippets.

View planetis-m's full-sized avatar
🏖️
Stand-by.

Antonis Geralis planetis-m

🏖️
Stand-by.
View GitHub Profile
def is_diacritics_correct(word):
diaeresis_chars = 'ϊϋΐΰ'
vowels_with_accent = 'άέήίόύώ'
diphthongs = ['αι', 'ει', 'οι', 'υι', 'αυ', 'ευ', 'ου']
once = False
for i, char in enumerate(word):
if char in diaeresis_chars:
if once:
return False
from spellchecker import SpellChecker
from prompt_toolkit import PromptSession
from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.document import Document
from prompt_toolkit.formatted_text import FormattedText
from prompt_toolkit.layout.processors import Processor, Transformation, TransformationInput, ConditionalProcessor
from prompt_toolkit.application.current import get_app
from prompt_toolkit.filters import Condition
from functools import lru_cache
import hashlib
import random
import os
import string
import polib
# import tempfile
# import subprocess
from termcolor import colored
from difflib import SequenceMatcher
# Letter Frequencies of the Greek language
import os
def process_file(file_path, pattern_length=100):
try:
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
if len(content) <= pattern_length:
print(f"Skipping {file_path}: File is too short.")
return
import re
def process_line(line):
if not line.startswith('+msgstr'):
return line
# Extract the content within quotes
content = re.search(r'\+msgstr "(.*)"', line)
if not content:
return line
- Προτίμησε την παθητική έναντι της ενεργητικής
Χρησιμοποίησε την παθητική φωνή (π.χ. βρίσκομαι, αποθηκεύομαι) αντί για την ενεργητική (π.χ. βρίσκω, αποθηκεύω), ή τη γραφή σε α' πρόσωπο.
Παραδείγματα στην παθητική φωνή:
Αρχικό: File Not Found
Σωστό: Δε βρέθηκε το αρχείο
Λάθος: Δε βρήκα το αρχείο

COMP-498: Final Year Project I Proposal

Project Title: Using LLMs to Automate KDE Translations

Mission Statement

Translating FOSS software projects is often a thankless job, with fewer and fewer active contributors. Currently, the KDE-el translation team is dissolved. The steady decline in approved translations, as evident from the statistics, will likely lead to the Greek translation being excluded from the KDE release in the near future. Since this decision will be based on the percentage of translated messages according to the guidelines outlined here: https://l10n.kde.org/docs/translation-howto/translation-howto.docbook, there is a pressing need for action to prevent this decline.

Fortunately, with the advent of numerous open LLMs that excel at translation tasks, we may be able to reverse this trend.

type
StableChunk[T] = object
next: ptr StableChunk[T]
len, cap: int
data: UncheckedArray[T]
StableSeq*[T] = object
head, tail: ptr StableChunk[T]
current: ptr StableChunk[T]
currentIndex: int
proc sortObject(tree: var JsonTree, n: NodePos) =
var pairs: seq[(string, NodePos)]
for ch0 in sonsReadonly(tree, n):
let key = firstSon(NodePos ch0.pos).str
let value = NodePos(ch0.pos + 2)
pairs.add((key, value))
pairs.sort do (a, b: (string, NodePos)) -> int:
cmp(a[0], b[0])
type
EmbeddedImage* = distinct Image
EmbeddedWave* = distinct Wave
EmbeddedFont* = distinct Font
ShaderLocsPtr* = distinct typeof(Shader.locs)
proc `=destroy`*(x: var EmbeddedImage) = discard
proc `=dup`*(source: EmbeddedImage): EmbeddedImage {.nodestroy.} = source
proc `=copy`*(dest: var EmbeddedImage; source: EmbeddedImage) {.nodestroy.} =