diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..feed463 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,14 @@ +[lint] + +ignore = [ + "F601", # Duplicate literal +] + +[lint.flake8-pytest-style] +fixture-parentheses = false + +[lint.pyupgrade] +keep-runtime-typing = true + +[lint.mccabe] +max-complexity = 25 \ No newline at end of file diff --git a/lib/lang/ar.py b/lib/lang/ar.py new file mode 100644 index 0000000..d5ef6c2 --- /dev/null +++ b/lib/lang/ar.py @@ -0,0 +1,167 @@ +def join_with_shared_prefix(a, b, joiner): + if a[:4] == "يوم " and b[:4] == "يوم " and joiner == " و ": + return "يومي " + a[4:] + joiner + b[4:] + else: + return a + joiner + b + + +def strip_prefix(period): + if period[:10] == "خلال الليل": + return period[5:] + elif period[:3] == "في ": + return period[3:] + else: + return period + + +def and_function(stack, a, b): + return join_with_shared_prefix(a, b, " و ") + + +def through_function(stack, a, b): + return join_with_shared_prefix(a, b, " حتى ") + + +def parenthetical_function(stack, a, b): + return a + " (" + b + (" من الثلج)" if a == "هطول أمطار وثلوج" else ")") + + +def until_function(stack, condition, period): + return condition + " حتى " + strip_prefix(period) + + +def until_starting_again_function(stack, condition, a, b): + return condition + " حتى " + strip_prefix(a) + " وتبدأ مجدداً في " + strip_prefix(b) + + +def starting_continuing_until_function(stack, condition, a, b): + return condition + " تبدأ في " + strip_prefix(a) + " وتستمر حتى " + strip_prefix(b) + + +template = { + "clear": "صافِ", + "no-precipitation": "لا أمطار", + "mixed-precipitation": "هطول أمطار وثلوج", + "possible-very-light-precipitation": "إحتمالية هطول أمطار خفيفة", + "very-light-precipitation": "أمطار خفيفة", + "possible-light-precipitation": "إحتمالية هطول أمطار خفيفة", + "light-precipitation": "أمطار خفيفة", + "medium-precipitation": "أمطار متوسطة", + "heavy-precipitation": "أمطار غزيرة", + "possible-very-light-rain": "إحتمالية هطول أمطار خفيفة", + "very-light-rain": "أمطار خفيفة", + "possible-light-rain": "إحتمالية أمطار خفيفة", + "light-rain": "أمطار خفيفة", + "medium-rain": "أمطار متوسطة", + "heavy-rain": "أمطار غزيرة", + "possible-very-light-sleet": "إحتمالية موجة صقيع خفيفة", + "very-light-sleet": "موجة صقيع خفيفة", + "possible-light-sleet": "إحتمالية موجة صقيع خفيفة", + "light-sleet": "موجة صقيع خفيفة", + "medium-sleet": "صقيع", + "heavy-sleet": "موجة صقيع شديدة", + "possible-very-light-snow": "احتمالية تساقط ثلوج خفيفة", + "very-light-snow": "رياح خفيفة", + "possible-light-snow": "احتمالية تساقط ثلوج خفيفة", + "light-snow": "ثلوج خفيفة", + "medium-snow": "ثلوج", + "heavy-snow": "ثلوج كثيفة", + "possible-thunderstorm": "عواصف محتملة", + "thunderstorm": "عواصف", + "possible-medium-precipitation": "هطول الأمطار المحتمل", + "possible-heavy-precipitation": "هطول الأمطار الغزيرة المحتملة", + "possible-medium-rain": "أمطار محتملة", + "possible-heavy-rain": "أمطار غزيرة محتملة", + "possible-medium-sleet": "صقيع محتمل", + "possible-heavy-sleet": "أمطار ثلجية غزيرة محتملة", + "possible-medium-snow": "ثلوج محتملة", + "possible-heavy-snow": "ثلوج كثيفة محتملة", + "possible-freezing-drizzle": "رذاذ متجمد محتمل", + "freezing-drizzle": "رذاذ متجمد", + "possible-light-freezing-rain": "أمطار خفيفة متجمدة خفيفة محتملة", + "light-freezing-rain": "أمطار متجمدة خفيفة", + "possible-freezing-rain": "أمطار متجمدة محتملة", + "freezing-rain": "أمطار متجمدة", + "possible-heavy-freezing-rain": "أمطار متجمدة غزيرة محتملة", + "heavy-freezing-rain": "أمطار متجمدة غزيرة", + "possible-hail": "بَرَد محتمل", + "hail": "البَرَد", + "light-wind": "رياح خفيفة", + "medium-wind": "رياح متوسطة", + "heavy-wind": "عواصف", + "low-humidity": "اجواء جافة", + "high-humidity": "اجواء رطبة", + "fog": "اجواء غائمة", + "very-light-clouds": "واضح في الغالب", + "light-clouds": "غائم جزئياً", + "medium-clouds": "اجواء غائمة", + "heavy-clouds": "اجواء غائمة", + "today-morning": "هذا الصباح", + "later-today-morning": "لاحقاً هذا الصباح", + "today-afternoon": "بعد الظهر", + "later-today-afternoon": "لاحقاً بعد الظهر", + "today-evening": "هذا المساء", + "later-today-evening": "لاحقاً هذا المساء", + "today-night": "الليلة", + "later-today-night": "لاحقاً الليلة", + "tomorrow-morning": "الغد صباحاً", + "tomorrow-afternoon": "غداً بعد الظهر", + "tomorrow-evening": "الغد مساءً", + "tomorrow-night": "الغد ليلاً", + "morning": "في الصباح", + "afternoon": "بعد الظهيرة", + "evening": "في المساء", + "night": "خلال الليل", + "today": "اليوم", + "tomorrow": "غداً", + "sunday": "يوم الأحد", + "monday": "يوم الإثنين", + "tuesday": "يوم الثلاثاء", + "wednesday": "يوم الأربعاء", + "thursday": "يوم الخميس", + "friday": "يوم الجمعة", + "saturday": "يوم السبت", + "next-sunday": "الأحد القادم", + "next-monday": "الإثنين القادم", + "next-tuesday": "الثلاثاء القادم", + "next-wednesday": "الأربعاء القادم", + "next-thursday": "الخميس القادم", + "next-friday": "الجمعة القادمة", + "next-saturday": "السبت القادم", + "minutes": "$1 دقيقة", + "fahrenheit": "$1\u00b0F", + "celsius": "$1\u00b0C", + "inches": "$1 انش", + "centimeters": "$1 سم", + "less-than": "أقل من $1", + "and": and_function, + "through": through_function, + "with": "$1 مع $2", + "range": "$1\u2013$2", + "parenthetical": parenthetical_function, + "for-hour": "$1 لهذه الساعة", + "starting-in": "$1 تبدأ خلال $2", + "stopping-in": "$1 تتوقف خلال $2", + "starting-then-stopping-later": "$1 تبدأ خلال $2 وتتوقف لاحقاً خلال $3", + "stopping-then-starting-later": "$1 تتوقف خلال $2 وتبدأ لاحقاً خلال $3", + "for-day": "$1 خلال اليوم", + "starting": "$1 تبدأ $2", + "until": until_function, + "until-starting-again": until_starting_again_function, + "starting-continuing-until": starting_continuing_until_function, + "during": "$1 $2", + "for-week": "$1 خلال الأسبوع", + "over-weekend": "$1 خلال نهاية الأسبوع", + "temperatures-peaking": "درجات حرارة تبلغ ذروتها عند $1 $2", + "temperatures-rising": "درجات حرارة ترتفع حتى $1 $2", + "temperatures-valleying": "انخفاض درجات الحرارة لأدنى مستوى لها عند $1 $2", + "temperatures-falling": "درجات حرارة تنخفض حتى $1 $2", + "title": "$1", + "sentence": "$1", + "next-hour-forecast-status": "next hour forecasts are $1 due to $2", + "unavailable": "unavailable", + "temporarily-unavailable": "temporarily unavailable", + "partially-unavailable": "partially unavailable", + "station-offline": "all nearby radar stations being offline", + "station-incomplete": "gaps in coverage from nearby radar stations", +} diff --git a/lib/lang/az.py b/lib/lang/az.py new file mode 100644 index 0000000..97bd75b --- /dev/null +++ b/lib/lang/az.py @@ -0,0 +1,176 @@ +import re + + +def custom_capitalize(s): + return s[0].upper() + s[1:] if s else s + + +def and_function(stack, a, b): + return a + " və " + b + + +def through_function(stack, a, b): + return a + " ilə " + b + " arası" + + +def parenthetical_function(stack, a, b): + return f'{a} ({b}{" qar)" if a == "qarışıq yağış" else ")"}' + + +def until_function(stack, condition, period): + return condition + " " + period + " dayanacaq" + + +def until_starting_again_function(stack, condition, a, b): + return condition + " " + a + " dayanıb, " + b + " yenidən başlayacaq" + + +def starting_continuing_until_function(stack, condition, a, b): + return a + " " + condition + " başlayıb, " + b + " dayanacaq" + + +def title_function(stack, s): + # Apply custom_capitalize to every word + def replace_func(txt: str) -> str: + if txt in {"və", "düym", "sm."}: + return txt + return txt[0].upper() + txt[1:].lower() + + # Use regex to find all words with the specified letters + return re.sub(r"([a-zA-ZÇ窺IıƏəÖöĞğÜü.]+)", lambda m: replace_func(m.group(0)), s) + + +def sentence_function(stack, s): + s = custom_capitalize(s) + if not s.endswith("."): + s += "." + return s + + +template = { + "clear": "buludsuz", + "no-precipitation": "yağmursuz", + "mixed-precipitation": "qarışıq yağış", + "possible-very-light-precipitation": "yüngül yağış ehtimalı", + "very-light-precipitation": "yüngül yağış", + "possible-light-precipitation": "yüngül yağış ehtimalı", + "light-precipitation": "yüngül yağış", + "medium-precipitation": "yağış", + "heavy-precipitation": "güclü yağış", + "possible-very-light-rain": "çiskin yağış ehtimalı", + "very-light-rain": "çiskin", + "possible-light-rain": "yüngül yağış ehtimalı", + "light-rain": "yüngül yağış", + "medium-rain": "yağış", + "heavy-rain": "güclü yağış", + "possible-very-light-sleet": "yüngül sulu qar ehtimalı", + "very-light-sleet": "yüngül sulu qar", + "possible-light-sleet": "yüngül sulu qar ehtimalı", + "light-sleet": "yüngül sulu qar", + "medium-sleet": "sulu qar", + "heavy-sleet": "güclü sulu qar", + "possible-very-light-snow": "sulu qar ehtimalı", + "very-light-snow": "sulu qar", + "possible-light-snow": "yüngül qar ehtimalı", + "light-snow": "yüngül qar", + "medium-snow": "qar", + "heavy-snow": "güclü qar", + "possible-thunderstorm": "mümkün tufanlar", + "thunderstorm": "tufanlar", + "possible-medium-precipitation": "mümkün yağıntı", + "possible-heavy-precipitation": "mümkün ağır yağış", + "possible-medium-rain": "mümkün yağış", + "possible-heavy-rain": "mümkün güclü yağış", + "possible-medium-sleet": "mümkün sulu qar", + "possible-heavy-sleet": "mümkün ağır sulu qar", + "possible-medium-snow": "mümkün qar", + "possible-heavy-snow": "mümkün güclü qar", + "possible-freezing-drizzle": "mümkün donma çiskin", + "freezing-drizzle": "donmaq çiskin", + "possible-light-freezing-rain": "mümkün işıq donması yağış", + "light-freezing-rain": "yüngül donmuş yağış", + "possible-freezing-rain": "mümkün donma yağışı", + "freezing-rain": "donmuş yağış", + "possible-heavy-freezing-rain": "mümkün güclü donmuş yağış", + "heavy-freezing-rain": "güclü donmuş yağış", + "possible-hail": "mümkün dolu", + "hail": "dolu", + "light-wind": "sərin", + "medium-wind": "külək", + "heavy-wind": "güclü külək", + "low-humidity": "rütubətsiz", + "high-humidity": "rütubətli", + "fog": "dumanlı", + "very-light-clouds": "əsasən buludsuz", + "light-clouds": "qismən buludlu", + "medium-clouds": "əsasən buludlu", + "heavy-clouds": "tutqun hava", + "today-morning": "bu gün səhər", + "later-today-morning": "bu gün səhərdən sonra", + "today-afternoon": "bu gün günortadan sonra", + "later-today-afternoon": "bu gün günortadan sonra", + "today-evening": "bu gün axşam", + "later-today-evening": "bu gün axşam", + "today-night": "bu gün gecə", + "later-today-night": "bu gün gecə", + "tomorrow-morning": "sabah səhər", + "tomorrow-afternoon": "sabah günortadan sonra", + "tomorrow-evening": "sabah axşam", + "tomorrow-night": "sabah gecə", + "morning": "səhər", + "afternoon": "günortadan sonra", + "evening": "axşam", + "night": "gecə", + "today": "bu gün", + "tomorrow": "sabah", + "sunday": "bazar günü", + "monday": "bazar ertəsi", + "tuesday": "çərşənbə axşamı", + "wednesday": "çərşənbə günü", + "thursday": "cümə axşamı", + "friday": "cümə günü", + "saturday": "şənbə günü", + "next-sunday": "bazar günü", + "next-monday": "bazar ertəsi", + "next-tuesday": "çərşənbə axşamı", + "next-wednesday": "çərşənbə günü", + "next-thursday": "cümə axşamı", + "next-friday": "cümə günü", + "next-saturday": "şənbə günü", + "minutes": "$1 dəq.", + "fahrenheit": "$1\u00b0F", + "celsius": "$1\u00b0C", + "inches": "$1 düym", + "centimeters": "$1 sm.", + "less-than": "$1-dən aşağı", + "and": and_function, + "through": through_function, + "with": "$1, $2", + "range": "$1\u2013$2", + "parenthetical": parenthetical_function, + "for-hour": "1 saat boyunca $1 olacaq", + "starting-in": "$2 sonra $1 başlayacaq", + "stopping-in": "$1 $2 sonra dayanacaq", + "starting-then-stopping-later": "$1 $2 sonra başlayacaq, $3 davam edib dayanacaq", + "stopping-then-starting-later": "$1 $2 sonra dayanacaq, $3 sonra yenidən başlayacaq", + "for-day": "gün boyu $1 olacaq", + "starting": "$2 $1 başlayacaq", + "until": until_function, + "until-starting-again": until_starting_again_function, + "starting-continuing-until": starting_continuing_until_function, + "during": "$2 $1 olacaq", + "for-week": "həftə boyunca $1 olacaq", + "over-weekend": "həftə sonu $1 olacaq", + "temperatures-peaking": "$2 hava kəskin istiləşəcək və temperatur $1-yə qalxacaq", + "temperatures-rising": "$2 temperatur $1-yə qalxacaq", + "temperatures-valleying": "$2 hava kəskin soyuyacaq və temperatur $1-yə düşəcək", + "temperatures-falling": "$2 temperatur $1-yə düşəcək", + "title": title_function, + "sentence": sentence_function, + "next-hour-forecast-status": "next hour forecasts are $1 due to $2", + "unavailable": "unavailable", + "temporarily-unavailable": "temporarily unavailable", + "partially-unavailable": "partially unavailable", + "station-offline": "all nearby radar stations being offline", + "station-incomplete": "gaps in coverage from nearby radar stations", +} diff --git a/lib/lang/be.py b/lib/lang/be.py new file mode 100644 index 0000000..ecaa426 --- /dev/null +++ b/lib/lang/be.py @@ -0,0 +1,221 @@ +import re + + +def join_with_shared_prefix(a, b, joiner): + i = 0 + while i < len(a) and i < len(b) and ord(a[i]) == ord(b[i]): + i += 1 + while i > 0 and ord(a[i - 1]) != 32: # Check for space + i -= 1 + return a + joiner + b[i:] + + +def time2(time): + translations = { + "раніцай": "раніцы", + "днём": "сярэдзіны дня", + "вечарам": "вечара", + "ноччу": "ночы", + "сёння ранкам": "сённяшняй раніцы", + "сёння позняй раніцай": "сённяшняй позняй раніцы", + "сёння днём": "сярэдзіны дня", + "сёння познім днём": "сённяшняга позняга дня", + "сёння ўвечары": "сённяшняга вечара", + "сёння познім вечарам": "сённяшняга позняга вечара", + "сёння ноччу": "сённяшняй ночы", + "сёння позняй ноччу": "сённяшняй позняй ночы", + "заўтра раніцай": "заўтрашняй раніцы", + "заўтра днём": "заўтрашняга дня", + "заўтра ўвечары": "заўтрашняга вечара", + "ўвечары": "вечара", + "заўтра ноччу": "заўтрашняй ночы", + "у нядзелю": "нядзелі", + "у панядзелак": "панядзелка", + "у аўторак": "аўторка", + "у сераду": "серады", + "у чацвер": "чацвярга", + "у пятніцу": "пятніцы", + "у суботу": "суботы", + } + return translations.get(time, time) + + +def and_function(stack, a, b): + joiner = ", і " if "," in a else " і " + return join_with_shared_prefix(a, b, joiner) + + +def through_function(stack, a, b): + return join_with_shared_prefix(a, time2(b), " і да ") + + +def until_function(stack, condition, period): + return condition + " да " + time2(period) + + +def until_starting_again_function(stack, condition, a, b): + return condition + " да " + time2(a) + ", пачынаючыся зноў " + b + + +def starting_continuing_until_function(stack, condition, a, b): + return condition + ", пачынаючыся з " + time2(a) + ", і да " + time2(b) + + +def title_function(stack, s): + # Apply custom_capitalize to every word + return re.sub( + r"\S+", + lambda word: word.group(0).capitalize() + if word.group(0) != "і" + else word.group(0), + s, + ) + + +def sentence_function(stack, s): + # Replace 'у' with 'ў' after vowels + s = re.sub( + r"[аеёіоуыэюя]\sу", + lambda match: match.group(0)[:-1] + "ў", + s, + flags=re.IGNORECASE, + ) + # Capitalize the first letter + s = s[0].upper() + s[1:] if s else s + # Add a period if missing + if not s.endswith("."): + s += "." + return s + + +def during_function(stack, condition, time): + return f"{condition} {time}" + + +template = { + "clear": "ясна", + "no-precipitation": "без ападкаў", + "mixed-precipitation": "змешаныя ападкі", + "possible-very-light-precipitation": "магчымы нязначныя ападкі", + "very-light-precipitation": "нязначныя ападкі", + "possible-light-precipitation": "магчымы невялікія ападкі", + "light-precipitation": "невялікія ападкі", + "medium-precipitation": "ападкі", + "heavy-precipitation": "моцныя ападкі", + "possible-very-light-rain": "магчымы нязначны дождж", + "very-light-rain": "нязначны дождж", + "possible-light-rain": "магчымы невялікі дождж", + "light-rain": "невялікі дождж", + "medium-rain": "дождж", + "heavy-rain": "моцны дождж", + "possible-very-light-sleet": "магчымы нязначны град", + "very-light-sleet": "нязначны град", + "possible-light-sleet": "магчымы невялікі град", + "light-sleet": "невялікі град", + "medium-sleet": "град", + "heavy-sleet": "моцны град", + "possible-very-light-snow": "магчымы нязначны снег", + "very-light-snow": "нязначны снег", + "possible-light-snow": "магчымы невялікі снег", + "light-snow": "невялікі снег", + "medium-snow": "снег", + "heavy-snow": "снегапад", + "possible-thunderstorm": "магчымы навальніцы", + "thunderstorm": "навальніцы", + "possible-medium-precipitation": "магчымы ападкі", + "possible-heavy-precipitation": "магчымы моцныя ападкі", + "possible-medium-rain": "магчымы дождж", + "possible-heavy-rain": "магчымы моцны дождж", + "possible-medium-sleet": "магчымы град", + "possible-heavy-sleet": "магчымы моцны град", + "possible-medium-snow": "магчымы снег", + "possible-heavy-snow": "магчымы моцны снег", + "possible-freezing-drizzle": "магчымы замарожванне нязначны дождж", + "freezing-drizzle": "freezing нязначны дождж", + "possible-light-freezing-rain": "магчымы невялікі замарожванне дождж", + "light-freezing-rain": "light замарожванне дождж", + "possible-freezing-rain": "магчымы замарожванне дождж", + "freezing-rain": "freezing дождж", + "possible-heavy-freezing-rain": "магчымы моцны замарожванне дождж", + "heavy-freezing-rain": "heavy замарожванне дождж", + "possible-hail": "магчымы град", + "hail": "град", + "light-wind": "слабы вецер", + "medium-wind": "вецер", + "heavy-wind": "моцны вецер", + "low-humidity": "суха", + "high-humidity": "вільготна", + "fog": "туман", + "very-light-clouds": "моцная ясна", + "light-clouds": "невялікая воблачнасць", + "medium-clouds": "воблачна", + "heavy-clouds": "моцная воблачнасць", + "today-morning": "сёння ранкам", + "later-today-morning": "сёння позняй раніцай", + "today-afternoon": "сёння днём", + "later-today-afternoon": "сёння познім днём", + "today-evening": "сёння ўвечары", + "later-today-evening": "сёння познім вечарам", + "today-night": "сёння ноччу", + "later-today-night": "сёння позняй ноччу", + "tomorrow-morning": "заўтра раніцай", + "tomorrow-afternoon": "заўтра днём", + "tomorrow-evening": "заўтра ўвечары", + "tomorrow-night": "заўтра ноччу", + "morning": "раніцай", + "afternoon": "днём", + "evening": "ўвечары", + "night": "ноччу", + "today": "сёння", + "tomorrow": "заўтра", + "sunday": "у нядзелю", + "monday": "у панядзелак", + "tuesday": "у аўторак", + "wednesday": "у сераду", + "thursday": "у чацвер", + "friday": "у пятніцу", + "saturday": "у суботу", + "next-sunday": "у наступную нядзелю", + "next-monday": "у наступны панядзелак", + "next-tuesday": "у наступны аўторак", + "next-wednesday": "у наступную сераду", + "next-thursday": "у наступны чацвер", + "next-friday": "у наступную пятніцу", + "next-saturday": "у наступную суботу", + "minutes": "$1 хв", + "fahrenheit": "$1\u00b0F", + "celsius": "$1\u00b0C", + "inches": "$1 in.", + "centimeters": "$1 см.", + "less-than": "менш за $1", + "and": and_function, + "through": through_function, + "with": "$1, з $2", + "range": "$1\u2013$2", + "parenthetical": "$1 ($2)", + "for-hour": "$1 на працягу наступнай гадзіны", + "starting-in": "$1 пачынаецца на працягу $2", + "stopping-in": "$1 заканчваецца на працягу $2", + "starting-then-stopping-later": "$1 пачынаецца на працягу $2, і заканчваецца праз $3", + "stopping-then-starting-later": "$1 заканчваецца на працягу $2, і пачынаецца зноў праз $3", + "for-day": "$1 на працягу ўсяго дня", + "starting": "$1 пачынаецца $2", + "until": until_function, + "until-starting-again": until_starting_again_function, + "starting-continuing-until": starting_continuing_until_function, + "during": during_function, + "for-week": "$1 на працягу ўсяго тыдня", + "over-weekend": "$1 на працягу ўсіх выходных", + "temperatures-peaking": "тэмпературай, што ўздымаецца да максімуму $1 $2", + "temperatures-rising": "тэмпературай, што ўздымаецца да $1 $2", + "temperatures-valleying": "тэмпературай, якая апускаецца да $1 $2", + "temperatures-falling": "тэмпературай, якая апускаецца да мінімуму $1 $2", + "title": title_function, + "sentence": sentence_function, + "next-hour-forecast-status": "next hour forecasts are $1 due to $2", + "unavailable": "unavailable", + "temporarily-unavailable": "temporarily unavailable", + "partially-unavailable": "partially unavailable", + "station-offline": "all nearby radar stations being offline", + "station-incomplete": "gaps in coverage from nearby radar stations", +} diff --git a/lib/lang/ja.py b/lib/lang/ja.py new file mode 100644 index 0000000..c743f7a --- /dev/null +++ b/lib/lang/ja.py @@ -0,0 +1,156 @@ +def join_with_shared_prefix(a, b, joiner): + i = 0 + + # Find the shared prefix length where characters match + while i != len(a) and i != len(b) and ord(a[i]) == ord(b[i]): + i += 1 + + # Move back to the last space character if needed + while i > 0 and a[i - 1] != " ": + i -= 1 + + # Return the concatenated result + return a[:i] + a[i:] + joiner + b[i:] + + +def and_function(stack, a, b): + return join_with_shared_prefix(a, b, ",及び" if "," in a else "及び") + + +def through_function(stack, a, b): + return join_with_shared_prefix(a, b, "から") + + +def sentence_function(stack, s): + if not s.endswith("。"): + s += "。" + return s + + +template = { + "clear": "晴れ", + "no-precipitation": "降水なし", + "mixed-precipitation": "みぞれ", + "possible-very-light-precipitation": "弱い降水の可能性あり", + "very-light-precipitation": "弱い降水", + "possible-light-precipitation": "弱い降水の可能性あり", + "light-precipitation": "弱い降水", + "medium-precipitation": "降水", + "heavy-precipitation": "強い降水", + "possible-very-light-rain": "霧雨の可能性あり", + "very-light-rain": "霧雨", + "possible-light-rain": "小雨の可能性あり", + "light-rain": "小雨", + "medium-rain": "雨", + "heavy-rain": "大雨", + "possible-very-light-sleet": "弱いみぞれの可能性あり", + "very-light-sleet": "弱いみぞれ", + "possible-light-sleet": "弱いみぞれの可能性あり", + "light-sleet": "弱いみぞれ", + "medium-sleet": "みぞれ", + "heavy-sleet": "強いみぞれ", + "possible-very-light-snow": "にわか雪の可能性あり", + "very-light-snow": "にわか雪", + "possible-light-snow": "小雪の可能性あり", + "light-snow": "小雪", + "medium-snow": "雪", + "heavy-snow": "大雪", + "possible-thunderstorm": "激しい雷雨の可能性あり", + "thunderstorm": "雷雨", + "possible-medium-precipitation": "降水の可能性あり", + "possible-heavy-precipitation": "大降水の可能性あり", + "possible-medium-rain": "雨の可能性あり", + "possible-heavy-rain": "大雨の可能性あり", + "possible-medium-sleet": "みぞれの可能性あり", + "possible-heavy-sleet": "強いみぞれの可能性あり", + "possible-medium-snow": "雪の可能性あり", + "possible-heavy-snow": "大雪の可能性あり", + "possible-freezing-drizzle": "凍りつく霧雨の可能性あり", + "freezing-drizzle": "凍りつく霧雨", + "possible-light-freezing-rain": "軽い氷雨の可能性あり", + "light-freezing-rain": "軽い氷雨", + "possible-freezing-rain": "凍雨の可能性あり", + "freezing-rain": "凍雨", + "possible-heavy-freezing-rain": "大凍雨の可能性あり", + "heavy-freezing-rain": "大凍雨", + "possible-hail": "雹の可能性あり", + "hail": "雹", + "light-wind": "弱い風", + "medium-wind": "強い風", + "heavy-wind": "猛烈な風", + "low-humidity": "乾燥", + "high-humidity": "多湿", + "fog": "霧", + "very-light-clouds": "ほぼ晴れ", + "light-clouds": "薄曇り", + "medium-clouds": "曇り", + "heavy-clouds": "曇り", + "today-morning": "今朝", + "later-today-morning": "今日の午前中", + "today-afternoon": "今日の昼過ぎ", + "later-today-afternoon": "今日の夕方", + "today-evening": "今日の夜の初め頃", + "later-today-evening": "今日の夜遅く", + "today-night": "今夜", + "later-today-night": "今夜遅く", + "tomorrow-morning": "明日の朝", + "tomorrow-afternoon": "明日の昼過ぎ", + "tomorrow-evening": "明日の夕方", + "tomorrow-night": "明日の夜", + "morning": "朝", + "afternoon": "昼過ぎ", + "evening": "夕方", + "night": "夜", + "today": "今日", + "tomorrow": "明日", + "sunday": "日曜日", + "monday": "月曜日", + "tuesday": "火曜日", + "wednesday": "水曜日", + "thursday": "木曜日", + "friday": "金曜日", + "saturday": "土曜日", + "next-sunday": "次の日曜日", + "next-monday": "次の月曜日", + "next-tuesday": "次の火曜日", + "next-wednesday": "次の水曜日", + "next-thursday": "次の木曜日", + "next-friday": "次の金曜日", + "next-saturday": "次の土曜日", + "minutes": "$1分", + "fahrenheit": "$1\u00b0F", + "celsius": "$1\u00b0C", + "inches": "$1インチ", + "centimeters": "$1センチメートル", + "less-than": "$1未満", + "and": and_function, + "through": through_function, + "with": "$1$2", + "range": "$1\u2013$2", + "parenthetical": "$1 ($2)", + "for-hour": "一時間$1。", + "starting-in": "$1が$2に始まる。", + "stopping-in": "$1が$2に終わる。", + "starting-then-stopping-later": "$1が$2に始まり、$3後終わる。", + "stopping-then-starting-later": "$1が$2に終わり、また$3後始まる。", + "for-day": "一日中$1。", + "starting": "$2から$1が始まる。", + "until": "$2まで$1。", + "until-starting-again": "$2まで$1、$3からまた始まる。", + "starting-continuing-until": "$1が$2から始まり$3まで続く。", + "during": "$2にかけて$1。", + "for-week": "一週間中$1。", + "over-weekend": "土、日曜日に$1。", + "temperatures-peaking": "$2は最高気温$1。", + "temperatures-rising": "気温は$1、$2に上がる", + "temperatures-valleying": "$2は最低気温$1。", + "temperatures-falling": "気温は$1、$2に下がる", + "title": "$1", + "sentence": sentence_function, + "next-hour-forecast-status": "next hour forecasts are $1 due to $2", + "unavailable": "unavailable", + "temporarily-unavailable": "temporarily unavailable", + "partially-unavailable": "partially unavailable", + "station-offline": "all nearby radar stations being offline", + "station-incomplete": "gaps in coverage from nearby radar stations", +} diff --git a/lib/lang/x-pig-latin.py b/lib/lang/x-pig-latin.py new file mode 100644 index 0000000..4f28651 --- /dev/null +++ b/lib/lang/x-pig-latin.py @@ -0,0 +1,191 @@ +import re + + +def join_with_shared_prefix(a, b, joiner): + m = a + i = 0 + + # HACK: This replicates the JS logic. + if m == "odaytay" or m == "omorrowtay": + m = "onway " + m + + # Skip the prefix of b that is shared with a. + min_len = min(len(m), len(b)) + while i < min_len and ord(m[i]) == ord(b[i]): + i += 1 + + # ...except whitespace! We need that whitespace! + # Move back until we hit a space or start of string + while i > 0 and (i > len(b) or (i <= len(b) and b[i - 1] != " ")): + i -= 1 + + return a + joiner + b[i:] + + +def strip_prefix(period): + if period.startswith("overnightway"): + return "ightnay" + period[12:] + elif period.startswith("inway ethay "): + return period[12:] + return period + + +def and_function(stack, a, b): + return join_with_shared_prefix(a, b, ", andway " if "," in a else " andway ") + + +def through_function(stack, a, b): + return join_with_shared_prefix(a, b, " oughthray ") + + +def until_function(stack, condition, period): + return condition + " untilway " + strip_prefix(period) + + +def until_starting_again_function(stack, condition, a, b): + return condition + " untilway " + strip_prefix(a) + ", artingstay againway " + b + + +def starting_continuing_until_function(stack, condition, a, b): + return condition + " artingstay " + a + ", ontinuingcay untilway " + strip_prefix(b) + + +def title_function(stack, s): + # Apply custom_capitalize to every word + return re.sub(r"\b(?:a(?!ndway\b)|[^\Wa])", lambda match: match.group(0).upper(), s) + + +def sentence_function(stack, s): + s = s[0].upper() + s[1:] + if not s.endswith("."): + s += "." + return s + + +template = { + "clear": "earclay", + "no-precipitation": "onay ecipitationpray", + "mixed-precipitation": "ixedmay ecipitationpray", + "possible-very-light-precipitation": "ossiblepay ightlay ecipitationpray", + "very-light-precipitation": "ightlay ecipitationpray", + "possible-light-precipitation": "ossiblepay ightlay ecipitationpray", + "light-precipitation": "ightlay ecipitationpray", + "medium-precipitation": "ecipitationpray", + "heavy-precipitation": "eavyhay ecipitationpray", + "possible-very-light-rain": "ossiblepay izzledray", + "very-light-rain": "izzledray", + "possible-light-rain": "ossiblepay ightlay ainray", + "light-rain": "ightlay ainray", + "medium-rain": "ainray", + "heavy-rain": "eavyhay ainray", + "possible-very-light-sleet": "ossiblepay ightlay eetslay", + "very-light-sleet": "ightlay eetslay", + "possible-light-sleet": "ossiblepay ightlay eetslay", + "light-sleet": "ightlay eetslay", + "medium-sleet": "eetslay", + "heavy-sleet": "eavyhay eetslay", + "possible-very-light-snow": "ossiblepay urriesflay", + "very-light-snow": "urriesflay", + "possible-light-snow": "ossiblepay ightlay owsnay", + "light-snow": "ightlay owsnay", + "medium-snow": "owsnay", + "heavy-snow": "eavyhay owsnay", + "possible-thunderstorm": "ossiblepay understormsthay", + "thunderstorm": "understormsthay", + "possible-medium-precipitation": "ossiblepay ecipitationpray", + "possible-heavy-precipitation": "ossiblepay eavyhay ecipitationpray", + "possible-medium-rain": "ossiblepay ainray", + "possible-heavy-rain": "ossiblepay eavyhay ainray", + "possible-medium-sleet": "ossiblepay eetslay", + "possible-heavy-sleet": "ossiblepay eavyhay eetslay", + "possible-medium-snow": "ossiblepay owsnay", + "possible-heavy-snow": "ossiblepay eavyhay owsnay", + "possible-freezing-drizzle": "ossiblepay eezingfray izzledray", + "freezing-drizzle": "eezingfray izzledray", + "possible-light-freezing-rain": "ossiblepay ightlay eezingfray ainray", + "light-freezing-rain": "ightlay eezingfray ainray", + "possible-freezing-rain": "ossiblepay eezingfray ainray", + "freezing-rain": "eezingfray ainray", + "possible-heavy-freezing-rain": "ossiblepay eavyhay eezingfray ainray", + "heavy-freezing-rain": "eavyhay eezingfray ainray", + "possible-hail": "ossiblepay ailhay", + "hail": "ailhay", + "light-wind": "eezybray", + "medium-wind": "indyway", + "heavy-wind": "angerouslyday indyway", + "low-humidity": "ydray", + "high-humidity": "umidhay", + "fog": "oggyfay", + "very-light-clouds": "ostlymay earclay", + "light-clouds": "artlypay oudyclay", + "medium-clouds": "ostlymay oudyclay", + "heavy-clouds": "overcastway", + "today-morning": "isthay orningmay", + "later-today-morning": "aterlay isthay orningmay", + "today-afternoon": "isthay afternoonway", + "later-today-afternoon": "aterlay isthay afternoonway", + "today-evening": "isthay eveningway", + "later-today-evening": "aterlay isthay eveningway", + "today-night": "onighttay", + "later-today-night": "aterlay onighttay", + "tomorrow-morning": "omorrowtay orningmay", + "tomorrow-afternoon": "omorrowtay afternoonway", + "tomorrow-evening": "omorrowtay eveningway", + "tomorrow-night": "omorrowtay ightnay", + "morning": "inway ethay orningmay", + "afternoon": "inway ethay afternoonway", + "evening": "inway ethay eveningway", + "night": "overnightway", + "today": "odaytay", + "tomorrow": "omorrowtay", + "sunday": "onway undaysay", + "monday": "onway ondaymay", + "tuesday": "onway uesdaytay", + "wednesday": "onway ednesdayway", + "thursday": "onway ursdaythay", + "friday": "onway idayfray", + "saturday": "onway aturdaysay", + "next-sunday": "extnay undaysay", + "next-monday": "extnay ondaymay", + "next-tuesday": "extnay uesdaytay", + "next-wednesday": "extnay ednesdayway", + "next-thursday": "extnay ursdaythay", + "next-friday": "extnay idayfray", + "next-saturday": "extnay aturdaysay", + "minutes": "$1 min.", + "fahrenheit": "$1\u00b0F", + "celsius": "$1\u00b0C", + "inches": "$1 in.", + "centimeters": "$1 cm.", + "less-than": "underway $1", + "and": and_function, + "through": through_function, + "with": "$1, ithway $2", + "range": "$1\u2013$2", + "parenthetical": "$1 ($2)", + "for-hour": "$1 orfay ethay hourway", + "starting-in": "$1 artingstay inway $2", + "stopping-in": "$1 oppingstay inway $2", + "starting-then-stopping-later": "$1 artingstay inway $2, oppingstay $3 aterlay", + "stopping-then-starting-later": "$1 oppingstay inway $2, artingstay againway $3 aterlay", + "for-day": "$1 oughoutthray ethay ayday", + "starting": "$1 artingstay $2", + "until": until_function, + "until-starting-again": until_starting_again_function, + "starting-continuing-until": starting_continuing_until_function, + "during": "$1 $2", + "for-week": "$1 oughoutthray ethay eekway", + "over-weekend": "$1 overway ethay eekendway", + "temperatures-peaking": "emperaturestay eakingpay atway $1 $2", + "temperatures-rising": "emperaturestay isingray otay $1 $2", + "temperatures-valleying": "emperaturestay ottomingbay outway atway $1 $2", + "temperatures-falling": "emperaturestay allingfay otay $1 $2", + "title": title_function, + "sentence": sentence_function, + "next-hour-forecast-status": "extnay hourway orecastsfay areway $1 ueday otay $2.", + "unavailable": "unavailableway", + "temporarily-unavailable": "emporarilytay unavailableway", + "partially-unavailable": "artiallypay unavailableway", + "station-offline": "allway earbynay adarray tationssay eingbay offlineway", + "station-incomplete": "apsgay inway overagecay romfay earbynay adarray ationsstay", +} diff --git a/test.py b/test.py index a235d72..3e7b6c8 100644 --- a/test.py +++ b/test.py @@ -144,7 +144,9 @@ def test_languages(subtests): py_module_path = os.path.join(lang_dir, lang_name + ".py") # Dynamically load the Python module - l_spec = importlib.util.spec_from_file_location(lang_name, py_module_path) + l_spec = importlib.util.spec_from_file_location( + lang_name, py_module_path + ) l_mod = importlib.util.module_from_spec(l_spec) l_spec.loader.exec_module(l_mod) @@ -153,5 +155,10 @@ def test_languages(subtests): # There's no direct equivalent to Object.freeze() in Python, # but we trust that we won't modify 'template'. for source, expected in template.items(): - with subtests.test(msg="custom message", l_template=l_template, expected=expected, source=source): + with subtests.test( + msg="custom message", + l_template=l_template, + expected=expected, + source=source, + ): assert Translation(l_template).translate(expected) == source diff --git a/test_cases/ar.py b/test_cases/ar.py new file mode 100644 index 0000000..5fa64e9 --- /dev/null +++ b/test_cases/ar.py @@ -0,0 +1,219 @@ +# This would be one of your translations, as a Python dictionary +cases = { + "صافِ": ["title", "clear"], + "إحتمالية هطول أمطار خفيفة": ["title", "possible-very-light-precipitation"], + "أمطار خفيفة": ["title", "very-light-precipitation"], + "إحتمالية هطول أمطار خفيفة": ["title", "possible-light-precipitation"], + "أمطار خفيفة": ["title", "light-precipitation"], + "أمطار متوسطة": ["title", "medium-precipitation"], + "أمطار غزيرة": ["title", "heavy-precipitation"], + "إحتمالية هطول أمطار خفيفة": ["title", "possible-very-light-rain"], + "أمطار خفيفة": ["title", "very-light-rain"], + "إحتمالية أمطار خفيفة": ["title", "possible-light-rain"], + "أمطار خفيفة": ["title", "light-rain"], + "أمطار متوسطة": ["title", "medium-rain"], + "أمطار غزيرة": ["title", "heavy-rain"], + "إحتمالية موجة صقيع خفيفة": ["title", "possible-very-light-sleet"], + "موجة صقيع خفيفة": ["title", "very-light-sleet"], + "إحتمالية موجة صقيع خفيفة": ["title", "possible-light-sleet"], + "موجة صقيع خفيفة": ["title", "light-sleet"], + "صقيع": ["title", "medium-sleet"], + "موجة صقيع شديدة": ["title", "heavy-sleet"], + "احتمالية تساقط ثلوج خفيفة": ["title", "possible-very-light-snow"], + "ثلوج خفيفة": ["title", "very-light-snow"], + "احتمالية تساقط ثلوج خفيفة": ["title", "possible-light-snow"], + "ثلوج خفيفة": ["title", "light-snow"], + "ثلوج": ["title", "medium-snow"], + "ثلوج كثيفة": ["title", "heavy-snow"], + "رياح متوسطة": ["title", "medium-wind"], + "عواصف": ["title", "heavy-wind"], + "اجواء غائمة": ["title", "fog"], + "واضح في الغالب": ["title", "very-light-clouds"], + "غائم جزئياً": ["title", "light-clouds"], + "اجواء غائمة": ["title", "medium-clouds"], + "اجواء غائمة": ["title", "heavy-clouds"], + "اجواء جافة و رياح خفيفة": ["title", ["and", "low-humidity", "light-wind"]], + "أمطار خفيفة و عواصف": ["title", ["and", "very-light-rain", "heavy-wind"]], + "اجواء رطبة و غائم جزئياً": ["title", ["and", "high-humidity", "light-clouds"]], + "صافِ لهذه الساعة": ["sentence", ["for-hour", "clear"]], + "رياح خفيفة تبدأ خلال 35 دقيقة": [ + "sentence", + ["starting-in", "very-light-snow", ["minutes", 35]], + ], + "أمطار خفيفة تتوقف خلال 15 دقيقة": [ + "sentence", + ["stopping-in", "light-rain", ["minutes", 15]], + ], + "موجة صقيع شديدة تبدأ خلال 20 دقيقة وتتوقف لاحقاً خلال 30 دقيقة": [ + "sentence", + [ + "starting-then-stopping-later", + "heavy-sleet", + ["minutes", 20], + ["minutes", 30], + ], + ], + "أمطار متوسطة تتوقف خلال 25 دقيقة وتبدأ لاحقاً خلال 8 دقيقة": [ + "sentence", + [ + "stopping-then-starting-later", + "medium-rain", + ["minutes", 25], + ["minutes", 8], + ], + ], + "اجواء غائمة خلال اليوم": ["sentence", ["for-day", "medium-clouds"]], + "موجة صقيع خفيفة تبدأ في الصباح": [ + "sentence", + ["starting", "very-light-sleet", "morning"], + ], + "رياح متوسطة حتى الليلة": ["sentence", ["until", "medium-wind", "today-night"]], + "أمطار غزيرة حتى بعد الظهيرة": [ + "sentence", + ["until", "heavy-precipitation", "afternoon"], + ], + "رياح خفيفة بعد الظهيرة": ["sentence", ["during", "light-wind", "afternoon"]], + "ثلوج لاحقاً هذا المساء و الغد صباحاً": [ + "sentence", + ["during", "medium-snow", ["and", "later-today-evening", "tomorrow-morning"]], + ], + "أمطار غزيرة حتى لاحقاً هذا الصباح وتبدأ مجدداً في هذا المساء": [ + "sentence", + ["until-starting-again", "heavy-rain", "later-today-morning", "today-evening"], + ], + "اجواء غائمة تبدأ في المساء وتستمر حتى الليل": [ + "sentence", + ["starting-continuing-until", "heavy-clouds", "evening", "night"], + ], + "موجة صقيع خفيفة لاحقاً بعد الظهر و اجواء غائمة الغد صباحاً": [ + "sentence", + [ + "and", + ["during", "light-sleet", "later-today-afternoon"], + ["during", "fog", "tomorrow-morning"], + ], + ], + "عواصف تبدأ في هذا الصباح وتستمر حتى بعد الظهر و صقيع الغد صباحاً": [ + "sentence", + [ + "and", + [ + "starting-continuing-until", + "heavy-wind", + "today-morning", + "today-afternoon", + ], + ["during", "medium-sleet", "tomorrow-morning"], + ], + ], + "اجواء غائمة تبدأ لاحقاً الليلة و ثلوج كثيفة غداً بعد الظهر": [ + "sentence", + [ + "and", + ["starting", "heavy-clouds", "later-today-night"], + ["during", "heavy-snow", "tomorrow-afternoon"], + ], + ], + "اجواء جافة الليلة و أمطار خفيفة تبدأ في الغد مساءً وتستمر حتى الغد ليلاً": [ + "sentence", + [ + "and", + ["during", "low-humidity", "today-night"], + [ + "starting-continuing-until", + "light-precipitation", + "tomorrow-evening", + "tomorrow-night", + ], + ], + ], + "ثلوج (5 انش) خلال الليل": [ + "sentence", + ["during", ["parenthetical", "medium-snow", ["inches", 5]], "night"], + ], + "ثلوج خفيفة (2 سم) لاحقاً هذا الصباح": [ + "sentence", + [ + "during", + ["parenthetical", "light-snow", ["centimeters", 2]], + "later-today-morning", + ], + ], + "ثلوج كثيفة (8\u201312 انش) خلال اليوم": [ + "sentence", + ["for-day", ["parenthetical", "heavy-snow", ["inches", ["range", 8, 12]]]], + ], + "ثلوج (أقل من 1 سم) بعد الظهيرة": [ + "sentence", + [ + "during", + ["parenthetical", "medium-snow", ["less-than", ["centimeters", 1]]], + "afternoon", + ], + ], + "لا أمطار خلال الأسبوع مع درجات حرارة تبلغ ذروتها عند 85\u00b0F غداً": [ + "sentence", + [ + "with", + ["for-week", "no-precipitation"], + ["temperatures-peaking", ["fahrenheit", 85], "tomorrow"], + ], + ], + "هطول أمطار وثلوج خلال نهاية الأسبوع مع درجات حرارة ترتفع حتى 32\u00b0C يوم الخميس": [ + "sentence", + [ + "with", + ["over-weekend", "mixed-precipitation"], + ["temperatures-rising", ["celsius", 32], "thursday"], + ], + ], + "أمطار خفيفة يوم الإثنين مع انخفاض درجات الحرارة لأدنى مستوى لها عند 15\u00b0F يوم الجمعة": [ + "sentence", + [ + "with", + ["during", "very-light-rain", "monday"], + ["temperatures-valleying", ["fahrenheit", 15], "friday"], + ], + ], + "ثلوج خفيفة يوم الثلاثاء و الأربعاء القادم مع درجات حرارة تنخفض حتى 0\u00b0C يوم الأحد": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "next-wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "ثلوج خفيفة يومي الثلاثاء و الأربعاء مع درجات حرارة تنخفض حتى 0\u00b0C يوم الأحد": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "أمطار متوسطة اليوم حتى يوم السبت مع درجات حرارة تبلغ ذروتها عند 100\u00b0F يوم الإثنين": [ + "sentence", + [ + "with", + ["during", "medium-precipitation", ["through", "today", "saturday"]], + ["temperatures-peaking", ["fahrenheit", 100], "monday"], + ], + ], + "عواصف محتملة": ["title", "possible-thunderstorm"], + "أمطار غزيرة و عواصف": ["title", ["and", "heavy-rain", "thunderstorm"]], + "هطول أمطار وثلوج (1\u20133 انش من الثلج) خلال اليوم": [ + "sentence", + [ + "for-day", + ["parenthetical", "mixed-precipitation", ["inches", ["range", 1, 3]]], + ], + ], + "ثلوج كثيفة (1\u20133 انش)": [ + "title", + ["parenthetical", "heavy-snow", ["inches", ["range", 1, 3]]], + ], + "ثلوج كثيفة (3\u20135 سم)": [ + "title", + ["parenthetical", "heavy-snow", ["centimeters", ["range", 3, 5]]], + ], +} diff --git a/test_cases/az.py b/test_cases/az.py new file mode 100644 index 0000000..7596f81 --- /dev/null +++ b/test_cases/az.py @@ -0,0 +1,215 @@ +# This would be one of your translations, as a Python dictionary +cases = { + "Buludsuz": ["title", "clear"], + "Yüngül Yağış Ehtimalı": ["title", "possible-very-light-precipitation"], + "Yüngül Yağış": ["title", "very-light-precipitation"], + "Yüngül Yağış Ehtimalı": ["title", "possible-light-precipitation"], + "Yüngül Yağış": ["title", "light-precipitation"], + "Yağış": ["title", "medium-precipitation"], + "Güclü Yağış": ["title", "heavy-precipitation"], + "Çiskin Yağış Ehtimalı": ["title", "possible-very-light-rain"], + "Çiskin": ["title", "very-light-rain"], + "Yüngül Yağış Ehtimalı": ["title", "possible-light-rain"], + "Yüngül Yağış": ["title", "light-rain"], + "Yağış": ["title", "medium-rain"], + "Güclü Yağış": ["title", "heavy-rain"], + "Yüngül Sulu Qar Ehtimalı": ["title", "possible-very-light-sleet"], + "Yüngül Sulu Qar": ["title", "very-light-sleet"], + "Yüngül Sulu Qar Ehtimalı": ["title", "possible-light-sleet"], + "Yüngül Sulu Qar": ["title", "light-sleet"], + "Sulu Qar": ["title", "medium-sleet"], + "Güclü Sulu Qar": ["title", "heavy-sleet"], + "Sulu Qar Ehtimalı": ["title", "possible-very-light-snow"], + "Sulu Qar": ["title", "very-light-snow"], + "Yüngül Qar Ehtimalı": ["title", "possible-light-snow"], + "Yüngül Qar": ["title", "light-snow"], + "Qar": ["title", "medium-snow"], + "Güclü Qar": ["title", "heavy-snow"], + "Külək": ["title", "medium-wind"], + "Güclü Külək": ["title", "heavy-wind"], + "Dumanlı": ["title", "fog"], + "Əsasən Buludsuz": ["title", "very-light-clouds"], + "Qismən Buludlu": ["title", "light-clouds"], + "Əsasən Buludlu": ["title", "medium-clouds"], + "Tutqun Hava": ["title", "heavy-clouds"], + "Rütubətsiz və Sərin": ["title", ["and", "low-humidity", "light-wind"]], + "Çiskin və Güclü Külək": ["title", ["and", "very-light-rain", "heavy-wind"]], + "Rütubətli və Qismən Buludlu": ["title", ["and", "high-humidity", "light-clouds"]], + "1 saat boyunca buludsuz olacaq.": ["sentence", ["for-hour", "clear"]], + "35 dəq. sonra sulu qar başlayacaq.": [ + "sentence", + ["starting-in", "very-light-snow", ["minutes", 35]], + ], + "Yüngül yağış 15 dəq. sonra dayanacaq.": [ + "sentence", + ["stopping-in", "light-rain", ["minutes", 15]], + ], + "Güclü sulu qar 20 dəq. sonra başlayacaq, 30 dəq. davam edib dayanacaq.": [ + "sentence", + [ + "starting-then-stopping-later", + "heavy-sleet", + ["minutes", 20], + ["minutes", 30], + ], + ], + "Yağış 25 dəq. sonra dayanacaq, 8 dəq. sonra yenidən başlayacaq.": [ + "sentence", + [ + "stopping-then-starting-later", + "medium-rain", + ["minutes", 25], + ["minutes", 8], + ], + ], + "Gün boyu əsasən buludlu olacaq.": ["sentence", ["for-day", "medium-clouds"]], + "Səhər yüngül sulu qar başlayacaq.": [ + "sentence", + ["starting", "very-light-sleet", "morning"], + ], + "Külək bu gün gecə dayanacaq.": [ + "sentence", + ["until", "medium-wind", "today-night"], + ], + "Güclü yağış günortadan sonra dayanacaq.": [ + "sentence", + ["until", "heavy-precipitation", "afternoon"], + ], + "Günortadan sonra sərin olacaq.": [ + "sentence", + ["during", "light-wind", "afternoon"], + ], + "Bu gün axşam və sabah səhər qar olacaq.": [ + "sentence", + ["during", "medium-snow", ["and", "later-today-evening", "tomorrow-morning"]], + ], + "Güclü yağış bu gün səhərdən sonra dayanıb, bu gün axşam yenidən başlayacaq.": [ + "sentence", + ["until-starting-again", "heavy-rain", "later-today-morning", "today-evening"], + ], + "Axşam tutqun hava başlayıb, gecə dayanacaq.": [ + "sentence", + ["starting-continuing-until", "heavy-clouds", "evening", "night"], + ], + "Bu gün günortadan sonra yüngül sulu qar olacaq və sabah səhər dumanlı olacaq.": [ + "sentence", + [ + "and", + ["during", "light-sleet", "later-today-afternoon"], + ["during", "fog", "tomorrow-morning"], + ], + ], + "Bu gün səhər güclü külək başlayıb, bu gün günortadan sonra dayanacaq və sabah səhər sulu qar olacaq.": [ + "sentence", + [ + "and", + [ + "starting-continuing-until", + "heavy-wind", + "today-morning", + "today-afternoon", + ], + ["during", "medium-sleet", "tomorrow-morning"], + ], + ], + "Bu gün gecə tutqun hava başlayacaq və sabah günortadan sonra güclü qar olacaq.": [ + "sentence", + [ + "and", + ["starting", "heavy-clouds", "later-today-night"], + ["during", "heavy-snow", "tomorrow-afternoon"], + ], + ], + "Bu gün gecə rütubətsiz olacaq və sabah axşam yüngül yağış başlayıb, sabah gecə dayanacaq.": [ + "sentence", + [ + "and", + ["during", "low-humidity", "today-night"], + [ + "starting-continuing-until", + "light-precipitation", + "tomorrow-evening", + "tomorrow-night", + ], + ], + ], + "Gecə qar (5 düym) olacaq.": [ + "sentence", + ["during", ["parenthetical", "medium-snow", ["inches", 5]], "night"], + ], + "Bu gün səhərdən sonra yüngül qar (2 sm.) olacaq.": [ + "sentence", + [ + "during", + ["parenthetical", "light-snow", ["centimeters", 2]], + "later-today-morning", + ], + ], + "Gün boyu güclü qar (8–12 düym) olacaq.": [ + "sentence", + ["for-day", ["parenthetical", "heavy-snow", ["inches", ["range", 8, 12]]]], + ], + "Günortadan sonra qar (1 sm.-dən aşağı) olacaq.": [ + "sentence", + [ + "during", + ["parenthetical", "medium-snow", ["less-than", ["centimeters", 1]]], + "afternoon", + ], + ], + "Həftə boyunca yağmursuz olacaq, sabah hava kəskin istiləşəcək və temperatur 85°F-yə qalxacaq.": [ + "sentence", + [ + "with", + ["for-week", "no-precipitation"], + ["temperatures-peaking", ["fahrenheit", 85], "tomorrow"], + ], + ], + "Həftə sonu qarışıq yağış olacaq, cümə axşamı temperatur 32°C-yə qalxacaq.": [ + "sentence", + [ + "with", + ["over-weekend", "mixed-precipitation"], + ["temperatures-rising", ["celsius", 32], "thursday"], + ], + ], + "Bazar ertəsi çiskin olacaq, cümə günü hava kəskin soyuyacaq və temperatur 15°F-yə düşəcək.": [ + "sentence", + [ + "with", + ["during", "very-light-rain", "monday"], + ["temperatures-valleying", ["fahrenheit", 15], "friday"], + ], + ], + "Çərşənbə axşamı və çərşənbə günü yüngül qar olacaq, bazar günü temperatur 0°C-yə düşəcək.": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "Bu gün ilə şənbə günü arası yağış olacaq, bazar ertəsi hava kəskin istiləşəcək və temperatur 100°F-yə qalxacaq.": [ + "sentence", + [ + "with", + ["during", "medium-precipitation", ["through", "today", "saturday"]], + ["temperatures-peaking", ["fahrenheit", 100], "monday"], + ], + ], + "Gün boyu qarışıq yağış (1–3 düym qar) olacaq.": [ + "sentence", + [ + "for-day", + ["parenthetical", "mixed-precipitation", ["inches", ["range", 1, 3]]], + ], + ], + "Güclü Qar (1–3 düym)": [ + "title", + ["parenthetical", "heavy-snow", ["inches", ["range", 1, 3]]], + ], + "Güclü Qar (3–5 sm.)": [ + "title", + ["parenthetical", "heavy-snow", ["centimeters", ["range", 3, 5]]], + ], +} diff --git a/test_cases/be.py b/test_cases/be.py new file mode 100644 index 0000000..deba90c --- /dev/null +++ b/test_cases/be.py @@ -0,0 +1,201 @@ +# This would be one of your translations, as a Python dictionary +cases = { + "Ясна": ["title", "clear"], + "Магчымы Нязначныя Ападкі": ["title", "possible-very-light-precipitation"], + "Нязначныя Ападкі": ["title", "very-light-precipitation"], + "Магчымы Невялікія Ападкі": ["title", "possible-light-precipitation"], + "Невялікія Ападкі": ["title", "light-precipitation"], + "Ападкі": ["title", "medium-precipitation"], + "Моцныя Ападкі": ["title", "heavy-precipitation"], + "Магчымы Нязначны Дождж": ["title", "possible-very-light-rain"], + "Нязначны Дождж": ["title", "very-light-rain"], + "Магчымы Невялікі Дождж": ["title", "possible-light-rain"], + "Невялікі Дождж": ["title", "light-rain"], + "Дождж": ["title", "medium-rain"], + "Моцны Дождж": ["title", "heavy-rain"], + "Магчымы Нязначны Град": ["title", "possible-very-light-sleet"], + "Нязначны Град": ["title", "very-light-sleet"], + "Магчымы Невялікі Град": ["title", "possible-light-sleet"], + "Невялікі Град": ["title", "light-sleet"], + "Град": ["title", "medium-sleet"], + "Моцны Град": ["title", "heavy-sleet"], + "Магчымы Нязначны Снег": ["title", "possible-very-light-snow"], + "Нязначны Снег": ["title", "very-light-snow"], + "Магчымы Невялікі Снег": ["title", "possible-light-snow"], + "Невялікі Снег": ["title", "light-snow"], + "Снег": ["title", "medium-snow"], + "Снегапад": ["title", "heavy-snow"], + "Слабы Вецер": ["title", "light-wind"], + "Вецер": ["title", "medium-wind"], + "Моцны Вецер": ["title", "heavy-wind"], + "Суха": ["title", "low-humidity"], + "Вільготна": ["title", "high-humidity"], + "Туман": ["title", "fog"], + "Моцная Ясна": ["title", "very-light-clouds"], + "Невялікая Воблачнасць": ["title", "light-clouds"], + "Воблачна": ["title", "medium-clouds"], + "Моцная Воблачнасць": ["title", "heavy-clouds"], + "Суха і Слабы Вецер": ["title", ["and", "low-humidity", "light-wind"]], + "Нязначны Дождж і Моцны Вецер": ["title", ["and", "very-light-rain", "heavy-wind"]], + "Вільготна і Невялікая Воблачнасць": [ + "title", + ["and", "high-humidity", "light-clouds"], + ], + "Ясна на працягу наступнай гадзіны.": ["sentence", ["for-hour", "clear"]], + "Нязначны снег пачынаецца на працягу 35 хв.": [ + "sentence", + ["starting-in", "very-light-snow", ["minutes", 35]], + ], + "Невялікі дождж заканчваецца на працягу 15 хв.": [ + "sentence", + ["stopping-in", "light-rain", ["minutes", 15]], + ], + "Моцны град пачынаецца на працягу 20 хв, і заканчваецца праз 30 хв.": [ + "sentence", + [ + "starting-then-stopping-later", + "heavy-sleet", + ["minutes", 20], + ["minutes", 30], + ], + ], + "Дождж заканчваецца на працягу 25 хв, і пачынаецца зноў праз 8 хв.": [ + "sentence", + [ + "stopping-then-starting-later", + "medium-rain", + ["minutes", 25], + ["minutes", 8], + ], + ], + "Воблачна на працягу ўсяго дня.": ["sentence", ["for-day", "medium-clouds"]], + "Нязначны град пачынаецца раніцай.": [ + "sentence", + ["starting", "very-light-sleet", "morning"], + ], + "Вецер да сённяшняй ночы.": ["sentence", ["until", "medium-wind", "today-night"]], + "Моцныя ападкі да сярэдзіны дня.": [ + "sentence", + ["until", "heavy-precipitation", "afternoon"], + ], + "Слабы вецер днём.": ["sentence", ["during", "light-wind", "afternoon"]], + "Снег сёння познім вечарам і заўтра раніцай.": [ + "sentence", + ["during", "medium-snow", ["and", "later-today-evening", "tomorrow-morning"]], + ], + "Моцны дождж да сённяшняй позняй раніцы, пачынаючыся зноў сёння ўвечары.": [ + "sentence", + ["until-starting-again", "heavy-rain", "later-today-morning", "today-evening"], + ], + "Моцная воблачнасць, пачынаючыся з вечара, і да ночы.": [ + "sentence", + ["starting-continuing-until", "heavy-clouds", "evening", "night"], + ], + "Невялікі град сёння познім днём і туман заўтра раніцай.": [ + "sentence", + [ + "and", + ["during", "light-sleet", "later-today-afternoon"], + ["during", "fog", "tomorrow-morning"], + ], + ], + "Моцны вецер, пачынаючыся з раніцы, і да сярэдзіны дня, і град заўтра раніцай.": [ + "sentence", + [ + "and", + ["starting-continuing-until", "heavy-wind", "morning", "afternoon"], + ["during", "medium-sleet", "tomorrow-morning"], + ], + ], + "Моцная воблачнасць пачынаецца сёння позняй ноччу і снегапад заўтра днём.": [ + "sentence", + [ + "and", + ["starting", "heavy-clouds", "later-today-night"], + ["during", "heavy-snow", "tomorrow-afternoon"], + ], + ], + "Суха сёння ноччу і невялікія ападкі, пачынаючыся з заўтрашняга вечара, і да заўтрашняй ночы.": [ + "sentence", + [ + "and", + ["during", "low-humidity", "today-night"], + [ + "starting-continuing-until", + "light-precipitation", + "tomorrow-evening", + "tomorrow-night", + ], + ], + ], + "Снег (5 см.) ноччу.": [ + "sentence", + ["during", ["parenthetical", "medium-snow", ["centimeters", 5]], "night"], + ], + "Невялікі снег (2 см.) сёння позняй раніцай.": [ + "sentence", + [ + "during", + ["parenthetical", "light-snow", ["centimeters", 2]], + "later-today-morning", + ], + ], + "Снег (менш за 1 см.) днём.": [ + "sentence", + [ + "during", + ["parenthetical", "medium-snow", ["less-than", ["centimeters", 1]]], + "afternoon", + ], + ], + "Без ападкаў на працягу ўсяго тыдня, з тэмпературай, што ўздымаецца да максімуму 35\u00b0C заўтра.": [ + "sentence", + [ + "with", + ["for-week", "no-precipitation"], + ["temperatures-peaking", ["celsius", 35], "tomorrow"], + ], + ], + "Змешаныя ападкі на працягу ўсіх выходных, з тэмпературай, што ўздымаецца да 32\u00b0C у чацвер.": [ + "sentence", + [ + "with", + ["over-weekend", "mixed-precipitation"], + ["temperatures-rising", ["celsius", 32], "thursday"], + ], + ], + "Нязначны дождж у панядзелак, з тэмпературай, якая апускаецца да 15\u00b0C у пятніцу.": [ + "sentence", + [ + "with", + ["during", "very-light-rain", "monday"], + ["temperatures-valleying", ["celsius", 15], "friday"], + ], + ], + "Невялікі снег у аўторак і сераду, з тэмпературай, якая апускаецца да мінімуму 0°C у нядзелю.": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "Ападкі сёння і да суботы, з тэмпературай, што ўздымаецца да максімуму 37°C у панядзелак.": [ + "sentence", + [ + "with", + ["during", "medium-precipitation", ["through", "today", "saturday"]], + ["temperatures-peaking", ["celsius", 37], "monday"], + ], + ], + "Магчымы Навальніцы": ["title", "possible-thunderstorm"], + "Моцны Дождж і Навальніцы": ["title", ["and", "heavy-rain", "thunderstorm"]], + "Невялікі снег у аўторак і наступную сераду, з тэмпературай, якая апускаецца да мінімуму 0°C у нядзелю.": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "next-wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], +} diff --git a/test_cases/ja.py b/test_cases/ja.py new file mode 100644 index 0000000..f83af10 --- /dev/null +++ b/test_cases/ja.py @@ -0,0 +1,212 @@ +# This would be one of your translations, as a Python dictionary +cases = { + "晴れ": ["title", "clear"], + "弱い降水の可能性あり": ["title", "possible-very-light-precipitation"], + "弱い降水": ["title", "very-light-precipitation"], + "弱い降水の可能性あり": ["title", "possible-light-precipitation"], + "弱い降水": ["title", "light-precipitation"], + "降水": ["title", "medium-precipitation"], + "強い降水": ["title", "heavy-precipitation"], + "霧雨の可能性あり": ["title", "possible-very-light-rain"], + "霧雨": ["title", "very-light-rain"], + "小雨の可能性あり": ["title", "possible-light-rain"], + "小雨": ["title", "light-rain"], + "雨": ["title", "medium-rain"], + "大雨": ["title", "heavy-rain"], + "弱いみぞれの可能性あり": ["title", "possible-very-light-sleet"], + "弱いみぞれ": ["title", "very-light-sleet"], + "弱いみぞれの可能性あり": ["title", "possible-light-sleet"], + "弱いみぞれ": ["title", "light-sleet"], + "みぞれ": ["title", "medium-sleet"], + "強いみぞれ": ["title", "heavy-sleet"], + "にわか雪の可能性あり": ["title", "possible-very-light-snow"], + "にわか雪": ["title", "very-light-snow"], + "小雪の可能性あり": ["title", "possible-light-snow"], + "小雪": ["title", "light-snow"], + "雪": ["title", "medium-snow"], + "大雪": ["title", "heavy-snow"], + "強い風": ["title", "medium-wind"], + "猛烈な風": ["title", "heavy-wind"], + "霧": ["title", "fog"], + "ほぼ晴れ": ["title", "very-light-clouds"], + "薄曇り": ["title", "light-clouds"], + "曇り": ["title", "medium-clouds"], + "曇り": ["title", "heavy-clouds"], + "乾燥及び弱い風": ["title", ["and", "low-humidity", "light-wind"]], + "霧雨及び猛烈な風": ["title", ["and", "very-light-rain", "heavy-wind"]], + "多湿及び薄曇り": ["title", ["and", "high-humidity", "light-clouds"]], + "一時間晴れ。": ["sentence", ["for-hour", "clear"]], + "にわか雪が35分に始まる。": [ + "sentence", + ["starting-in", "very-light-snow", ["minutes", 35]], + ], + "小雨が15分に終わる。": [ + "sentence", + ["stopping-in", "light-rain", ["minutes", 15]], + ], + "強いみぞれが20分に始まり、30分後終わる。": [ + "sentence", + [ + "starting-then-stopping-later", + "heavy-sleet", + ["minutes", 20], + ["minutes", 30], + ], + ], + "雨が25分に終わり、また8分後始まる。": [ + "sentence", + [ + "stopping-then-starting-later", + "medium-rain", + ["minutes", 25], + ["minutes", 8], + ], + ], + "一日中曇り。": ["sentence", ["for-day", "medium-clouds"]], + "朝から弱いみぞれが始まる。": [ + "sentence", + ["starting", "very-light-sleet", "morning"], + ], + "今夜まで強い風。": ["sentence", ["until", "medium-wind", "today-night"]], + "昼過ぎまで強い降水。": ["sentence", ["until", "heavy-precipitation", "afternoon"]], + "昼過ぎにかけて弱い風。": ["sentence", ["during", "light-wind", "afternoon"]], + "今日の夜遅く及び明日の朝にかけて雪。": [ + "sentence", + ["during", "medium-snow", ["and", "later-today-evening", "tomorrow-morning"]], + ], + "今日の午前中まで大雨、今日の夜の初め頃からまた始まる。": [ + "sentence", + ["until-starting-again", "heavy-rain", "later-today-morning", "today-evening"], + ], + "曇りが夕方から始まり夜まで続く。": [ + "sentence", + ["starting-continuing-until", "heavy-clouds", "evening", "night"], + ], + "今日の夕方にかけて弱いみぞれ。及び明日の朝にかけて霧。": [ + "sentence", + [ + "and", + ["during", "light-sleet", "later-today-afternoon"], + ["during", "fog", "tomorrow-morning"], + ], + ], + "猛烈な風が今朝から始まり今日の昼過ぎまで続く。及び明日の朝にかけてみぞれ。": [ + "sentence", + [ + "and", + [ + "starting-continuing-until", + "heavy-wind", + "today-morning", + "today-afternoon", + ], + ["during", "medium-sleet", "tomorrow-morning"], + ], + ], + "今夜遅くから曇りが始まる。及び明日の昼過ぎにかけて大雪。": [ + "sentence", + [ + "and", + ["starting", "heavy-clouds", "later-today-night"], + ["during", "heavy-snow", "tomorrow-afternoon"], + ], + ], + "今夜にかけて乾燥。及び弱い降水が明日の夕方から始まり明日の夜まで続く。": [ + "sentence", + [ + "and", + ["during", "low-humidity", "today-night"], + [ + "starting-continuing-until", + "light-precipitation", + "tomorrow-evening", + "tomorrow-night", + ], + ], + ], + "夜にかけて雪 (5インチ)。": [ + "sentence", + ["during", ["parenthetical", "medium-snow", ["inches", 5]], "night"], + ], + "今日の午前中にかけて小雪 (2センチメートル)。": [ + "sentence", + [ + "during", + ["parenthetical", "light-snow", ["centimeters", 2]], + "later-today-morning", + ], + ], + "一日中大雪 (8–12インチ)。": [ + "sentence", + ["for-day", ["parenthetical", "heavy-snow", ["inches", ["range", 8, 12]]]], + ], + "昼過ぎにかけて雪 (1センチメートル未満)。": [ + "sentence", + [ + "during", + ["parenthetical", "medium-snow", ["less-than", ["centimeters", 1]]], + "afternoon", + ], + ], + "一週間中降水なし。明日は最高気温85°F。": [ + "sentence", + [ + "with", + ["for-week", "no-precipitation"], + ["temperatures-peaking", ["fahrenheit", 85], "tomorrow"], + ], + ], + "土、日曜日にみぞれ。気温は32°C、木曜日に上がる。": [ + "sentence", + [ + "with", + ["over-weekend", "mixed-precipitation"], + ["temperatures-rising", ["celsius", 32], "thursday"], + ], + ], + "月曜日にかけて霧雨。金曜日は最低気温15°F。": [ + "sentence", + [ + "with", + ["during", "very-light-rain", "monday"], + ["temperatures-valleying", ["fahrenheit", 15], "friday"], + ], + ], + "火曜日及び次の水曜日にかけて小雪。気温は0°C、日曜日に下がる。": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "next-wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "今日から土曜日にかけて降水。月曜日は最高気温100°F。": [ + "sentence", + [ + "with", + ["during", "medium-precipitation", ["through", "today", "saturday"]], + ["temperatures-peaking", ["fahrenheit", 100], "monday"], + ], + ], + "一日中みぞれ (1–3インチ)。": [ + "sentence", + [ + "for-day", + ["parenthetical", "mixed-precipitation", ["inches", ["range", 1, 3]]], + ], + ], + "大雪 (1–3インチ)": [ + "title", + ["parenthetical", "heavy-snow", ["inches", ["range", 1, 3]]], + ], + "大雪 (3–5センチメートル)": [ + "title", + ["parenthetical", "heavy-snow", ["centimeters", ["range", 3, 5]]], + ], + "激しい雷雨の可能性あり": ["title", "possible-thunderstorm"], + "大雨及び雷雨": ["title", ["and", "heavy-rain", "thunderstorm"]], + "霧雨が1分未満に始まる。": [ + "sentence", + ["starting-in", "very-light-rain", ["less-than", ["minutes", 1]]], + ], +} diff --git a/test_cases/x-pig-latin.py b/test_cases/x-pig-latin.py new file mode 100644 index 0000000..1f51e31 --- /dev/null +++ b/test_cases/x-pig-latin.py @@ -0,0 +1,227 @@ +# This would be one of your translations, as a Python dictionary +cases = { + "Earclay": ["title", "clear"], + "Ossiblepay Ightlay Ecipitationpray": [ + "title", + "possible-very-light-precipitation", + ], + "Ightlay Ecipitationpray": ["title", "very-light-precipitation"], + "Ossiblepay Ightlay Ecipitationpray": ["title", "possible-light-precipitation"], + "Ightlay Ecipitationpray": ["title", "light-precipitation"], + "Ecipitationpray": ["title", "medium-precipitation"], + "Eavyhay Ecipitationpray": ["title", "heavy-precipitation"], + "Ossiblepay Izzledray": ["title", "possible-very-light-rain"], + "Izzledray": ["title", "very-light-rain"], + "Ossiblepay Ightlay Ainray": ["title", "possible-light-rain"], + "Ightlay Ainray": ["title", "light-rain"], + "Ainray": ["title", "medium-rain"], + "Eavyhay Ainray": ["title", "heavy-rain"], + "Ossiblepay Ightlay Eetslay": ["title", "possible-very-light-sleet"], + "Ightlay Eetslay": ["title", "very-light-sleet"], + "Eetslay": ["title", "medium-sleet"], + "Eavyhay Eetslay": ["title", "heavy-sleet"], + "Ossiblepay Urriesflay": ["title", "possible-very-light-snow"], + "Urriesflay": ["title", "very-light-snow"], + "Ossiblepay Ightlay Owsnay": ["title", "possible-light-snow"], + "Ightlay Owsnay": ["title", "light-snow"], + "Owsnay": ["title", "medium-snow"], + "Eavyhay Owsnay": ["title", "heavy-snow"], + "Indyway": ["title", "medium-wind"], + "Angerouslyday Indyway": ["title", "heavy-wind"], + "Oggyfay": ["title", "fog"], + "Ostlymay Earclay": ["title", "very-light-clouds"], + "Artlypay Oudyclay": ["title", "light-clouds"], + "Ostlymay Oudyclay": ["title", "medium-clouds"], + "Overcastway": ["title", "heavy-clouds"], + "Ydray andway Eezybray": ["title", ["and", "low-humidity", "light-wind"]], + "Izzledray andway Angerouslyday Indyway": [ + "title", + ["and", "very-light-rain", "heavy-wind"], + ], + "Umidhay andway Artlypay Oudyclay": [ + "title", + ["and", "high-humidity", "light-clouds"], + ], + "Earclay orfay ethay hourway.": ["sentence", ["for-hour", "clear"]], + "Urriesflay artingstay inway 35 min.": [ + "sentence", + ["starting-in", "very-light-snow", ["minutes", 35]], + ], + "Ightlay ainray oppingstay inway 15 min.": [ + "sentence", + ["stopping-in", "light-rain", ["minutes", 15]], + ], + "Eavyhay eetslay artingstay inway 20 min., oppingstay 30 min. aterlay.": [ + "sentence", + [ + "starting-then-stopping-later", + "heavy-sleet", + ["minutes", 20], + ["minutes", 30], + ], + ], + "Ainray oppingstay inway 25 min., artingstay againway 8 min. aterlay.": [ + "sentence", + [ + "stopping-then-starting-later", + "medium-rain", + ["minutes", 25], + ["minutes", 8], + ], + ], + "Ostlymay oudyclay oughoutthray ethay ayday.": [ + "sentence", + ["for-day", "medium-clouds"], + ], + "Ightlay eetslay artingstay inway ethay orningmay.": [ + "sentence", + ["starting", "very-light-sleet", "morning"], + ], + "Indyway untilway onighttay.": [ + "sentence", + ["until", "medium-wind", "today-night"], + ], + "Eavyhay ecipitationpray untilway afternoonway.": [ + "sentence", + ["until", "heavy-precipitation", "afternoon"], + ], + "Eezybray inway ethay afternoonway.": [ + "sentence", + ["during", "light-wind", "afternoon"], + ], + "Owsnay aterlay isthay eveningway andway omorrowtay orningmay.": [ + "sentence", + ["during", "medium-snow", ["and", "later-today-evening", "tomorrow-morning"]], + ], + "Eavyhay ainray untilway aterlay isthay orningmay, artingstay againway isthay eveningway.": [ + "sentence", + ["until-starting-again", "heavy-rain", "later-today-morning", "today-evening"], + ], + "Overcastway artingstay inway ethay eveningway, ontinuingcay untilway ightnay.": [ + "sentence", + ["starting-continuing-until", "heavy-clouds", "evening", "night"], + ], + "Ightlay eetslay aterlay isthay afternoonway andway oggyfay omorrowtay orningmay.": [ + "sentence", + [ + "and", + ["during", "light-sleet", "later-today-afternoon"], + ["during", "fog", "tomorrow-morning"], + ], + ], + "Angerouslyday indyway artingstay isthay orningmay, ontinuingcay untilway isthay afternoonway, andway eetslay omorrowtay orningmay.": [ + "sentence", + [ + "and", + [ + "starting-continuing-until", + "heavy-wind", + "today-morning", + "today-afternoon", + ], + ["during", "medium-sleet", "tomorrow-morning"], + ], + ], + "Overcastway artingstay aterlay onighttay andway eavyhay owsnay omorrowtay afternoonway.": [ + "sentence", + [ + "and", + ["starting", "heavy-clouds", "later-today-night"], + ["during", "heavy-snow", "tomorrow-afternoon"], + ], + ], + "Ydray onighttay andway ightlay ecipitationpray artingstay omorrowtay eveningway, ontinuingcay untilway omorrowtay ightnay.": [ + "sentence", + [ + "and", + ["during", "low-humidity", "today-night"], + [ + "starting-continuing-until", + "light-precipitation", + "tomorrow-evening", + "tomorrow-night", + ], + ], + ], + "Owsnay (5 in.) overnightway.": [ + "sentence", + ["during", ["parenthetical", "medium-snow", ["inches", 5]], "night"], + ], + "Ightlay owsnay (2 cm.) aterlay isthay orningmay.": [ + "sentence", + [ + "during", + ["parenthetical", "light-snow", ["centimeters", 2]], + "later-today-morning", + ], + ], + "Eavyhay owsnay (8\u201312 in.) oughoutthray ethay ayday.": [ + "sentence", + ["for-day", ["parenthetical", "heavy-snow", ["inches", ["range", 8, 12]]]], + ], + "Owsnay (underway 1 cm.) inway ethay afternoonway.": [ + "sentence", + [ + "during", + ["parenthetical", "medium-snow", ["less-than", ["centimeters", 1]]], + "afternoon", + ], + ], + "Onay ecipitationpray oughoutthray ethay eekway, ithway emperaturestay eakingpay atway 85\u00b0F omorrowtay.": [ + "sentence", + [ + "with", + ["for-week", "no-precipitation"], + ["temperatures-peaking", ["fahrenheit", 85], "tomorrow"], + ], + ], + "Ixedmay ecipitationpray overway ethay eekendway, ithway emperaturestay isingray otay 32\u00b0C onway ursdaythay.": [ + "sentence", + [ + "with", + ["over-weekend", "mixed-precipitation"], + ["temperatures-rising", ["celsius", 32], "thursday"], + ], + ], + "Izzledray onway ondaymay, ithway emperaturestay ottomingbay outway atway 15\u00b0F onway idayfray.": [ + "sentence", + [ + "with", + ["during", "very-light-rain", "monday"], + ["temperatures-valleying", ["fahrenheit", 15], "friday"], + ], + ], + "Ightlay owsnay onway uesdaytay andway extnay ednesdayway, ithway emperaturestay allingfay otay 0\u00b0C onway undaysay.": [ + "sentence", + [ + "with", + ["during", "light-snow", ["and", "tuesday", "next-wednesday"]], + ["temperatures-falling", ["celsius", 0], "sunday"], + ], + ], + "Ecipitationpray odaytay oughthray aturdaysay, ithway emperaturestay eakingpay atway 100\u00b0F onway ondaymay.": [ + "sentence", + [ + "with", + ["during", "medium-precipitation", ["through", "today", "saturday"]], + ["temperatures-peaking", ["fahrenheit", 100], "monday"], + ], + ], + "Ossiblepay Understormsthay": ["title", "possible-thunderstorm"], + "Eavyhay Ainray andway Understormsthay": [ + "title", + ["and", "heavy-rain", "thunderstorm"], + ], + "Extnay hourway orecastsfay areway emporarilytay unavailableway ueday otay allway earbynay adarray tationssay eingbay offlineway.": [ + "sentence", + ["next-hour-forecast-status", "temporarily-unavailable", "station-offline"], + ], + "Extnay hourway orecastsfay areway artiallypay unavailableway ueday otay apsgay inway overagecay romfay earbynay adarray ationsstay.": [ + "sentence", + ["next-hour-forecast-status", "partially-unavailable", "station-incomplete"], + ], + "Extnay hourway orecastsfay areway unavailableway ueday otay allway earbynay adarray tationssay eingbay offlineway.": [ + "sentence", + ["next-hour-forecast-status", "unavailable", "station-offline"], + ], +}