7
1
An Séimhiú agus an tUrú
In Irish Gaelic (Gaeilge) there are a number of ways that the start of a word can be changed. The most common of these are lenition (an séimhiú) and eclipsis (an t-urú)
Lenition involves adding the letter h as the second letter. For example, the word "bean" (woman) would be lenited to "bhean".
Eclipsing adds a prefix to the word. The prefix is determined by the first letter of the word. For example, the word "capall" (horse) starts with a c. Its eclipsis is g. So when the word "capall" is eclipsed it becomes "gcapall".
Challenge
Write a function or program that takes a word and returns both its lenited and eclipsed forms.
Lenition
Only words beginning with:
b
c
d
f
g
m
p
s
t
are lenited. Words beginning with other letters are not changed.
Some examples:
bean bhean
capall chapall
Sasana Shasana
lón lón
Ífreann Ífreann
Eclipsis
If a word starts with any of the following letters, it is prefixed by its respective eclipsis:
Letter Eclipsis
b m
c g
d n
f bh
g n
p b
t d
Words that don't start with those letters remain unchanged.
Examples:
bean mbean
capall gcapall
cailín gcailín
doras ndoras
fuinneog bhfuinneog
Gaeilge nGaeilge
Sasana Sasana
There are other changes that can happen to the start of a word, but we'll just focus on these ones.
Rules
The input is only one word. Words will only contain a-z
, A-Z
or the fada vowels á
, Á
, é
, É
, í
, Í
, ó
, Ó
, ú
and Ú
.
To make it a bit more simple the word itself doesn't necessarily need to be an Irish word, just that it is treated like one in the code. So inputting delta
should return dhelta
and ndelta
.
For this challenge you can assume that the input words have not already been lenited or eclipsed (in Irish, a word is only lenited or eclipsed once. You would never end up with "bhhean" or "ngcapall").
Standard rules apply, including the default I/O rules. Similarly, default loopholes are forbidden.
Finally, this is code-golf so shortest answer in bytes wins.
Test cases
Input Lenited Eclipsed
bean bhean mbean
capall chapall gcapall
fuinneog fhuinneog bhfuinneog
Sasana Shasana Sasana
Gaeilge Ghaeilge nGaeilge
lón lón lón
áthas áthas áthas
Ífreann Ífreann Ífreann
Sandbox post. – Ciaran_McCarthy – 2019-01-08T09:49:29.097
Yes, for example
Ífreann
oráthas
. In those cases, however, you would not change the word. – Ciaran_McCarthy – 2019-01-08T12:02:31.373what does the title mean? – Giuseppe – 2019-01-08T15:44:40.887
@Giuseppe I think it means lenition and eclipsis. Now, the special thing about Gaelic, is that it's hard to understand even once translated into English. :p – Arnauld – 2019-01-08T16:26:59.423
@Arnauld Google Translate gives "The Lenition and the Turu" for the first time and "The Sharing and the Substance" afterwards... "agus" translates to "and". – Erik the Outgolfer – 2019-01-08T16:33:09.557
2"(The) Lenition and (the) Eclipsis". I'm not a fluent speaker, so I don't know if it's correct to specify them with the definite article (an). Séimhiú is lenition and urú is eclipsis. In the title Urú takes a 't' at the start, because it starts with a vowel and is preceded by the definite article. When it's a capital letter there's no hyphen between them. Hence: "There are other changes that can happen to the start of a word, but we'll just focus on these ones." – Ciaran_McCarthy – 2019-01-08T16:43:51.947
1"but you would" ... the suspense is killing me! – Sparr – 2019-01-10T18:57:37.957
@Sparr I only just saw what you were referring to! I've removed the line, because it's not relevant to the challenge. But essentially, if you eclipsed 'capall' it would become 'gcapall'. But you would never eclipse it again, so you would never have 'ngcapall'. Similarly for lenition, you would have 'chapall' but never 'chhapall'. – Ciaran_McCarthy – 2019-01-10T22:56:06.497