Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Tuesday, 20 June 2017

Syllable segmentation: showing an error message if input not understood in full

In my previous post about filling in the gap in Bewnans Ke at the Cornish language weekend, I noticed that the Cornish word 'vyajya' (to travel) is not understood in full by the syllable segmentation module of taklow-kernewek, if the reverse segmentation mode is used starting from the end and working backwards, since it assumes the penultimate syllable is 'yaj' starting with a semivocalic y rather than a vowel y. This leaves 'v' on its own which is not matched by the regular expression as a syllable.

This can be compounded if accented or non-alphabetic characters are included. A warning can now be given in cases where not all of the input word is matched, using the command-line syllabenn_ranna_kw.py with the --warn option, or by checkboxes in sylrannakwGUI.py and sylrannacyGUI.py

The window in my netbook. If the box is ticked, a warning is given. One of my next things to do is to make the output box a little cleverer to avoid splitting lines in the middle of words.
The interface language is a bit confused, since the explanatory text here remains in Cornish, although the warning message is in Welsh this was done in not a very rational way, since this is hard-coded at the moment to appear in Cornish only in short or line mode, and bilingually Cornish/English in long mode, except if the CYmode flag is set this gets overridden and it displays the Welsh version. It probably needs a bit of an overhaul to change the language in a similar way to the corpus statistics module.

Saturday, 10 June 2017

General Election 2017 - and trying out the Python pandas library

I am happy to report that my computer is working again, after a reformat, Windows 7 installation, then a long delay while Ubuntu partition resizer stalled, then fixed that with a GParted iso, and then reinstalled Ubuntu 17.04 and I am part way through restoring data from backups.
QGIS is working with version 2.18.

Although I have used Python csv, matplotlib and numpy libraries to read data from files and plot I hadn't used the pandas library for anything much, so I thought I'd do so. I have in previous code often built up a list manually by setting data = [] and then using append to build up the list, which can be slow for large datasets.

First I need some data, and I will use the general election results for the 6 parliamentary constituencies for the House of Commons in Cornwall:


Constituency,Surname,Forenames,Description,Votes,Turnout
Camborne and Redruth,EUSTICE,Charles George,Conservative Party,23001,70.96
Camborne and Redruth,WINTER,Graham Robert,Labour Party,21424,70.96
Camborne and Redruth,WILLIAMS,Geoffrey,Liberal Democrats,2979,70.96
Camborne and Redruth,GARBETT,Geoffrey George,Green Party,1052,70.96
North Cornwall,MANN,Scott Leslie,Conservative Party,25835,74.2
North Cornwall,ROGERSON,Daniel John,Liberal Democrats,18635,74.2
North Cornwall,BASSETT,Joy,Labour Party,6151,74.2
North Cornwall,ALLMAN,John William,Christian Peoples Alliance,185,74.2
North Cornwall,HAWKINS,Robert James,Socialist Labour Party,138,74.2
South East Cornwall,MURRAY,Sheryll,Conservative Party,29493,74.2
South East Cornwall,DERRICK,Gareth Gwyn James,Labour Party,12050,74.2
South East Cornwall,HUTTY,Philip Andrew,Liberal Democrats,10346,74.2
South East Cornwall,CORNEY,Martin Charles Stewart,Green Party,1335,74.2
St Austell and Newquay,DOUBLE,Stephen Daniel,Conservative Party,26856,69.3
St Austell and Newquay,NEIL,Kevin Michael,Labour Party,15714,69.3
St Austell and Newquay,GILBERT ,Stephen David John ,Liberal Democrats,11642,69.3
St Ives,THOMAS,Derek,Conservative Party,22120,76.1
St Ives,GEORGE,Andrew Henry,Liberal Democrats,21808,76.1
St Ives,DREW,Christopher John,Labour Party,7298,76.1
Truro and Falmouth,NEWTON,Sarah Louise,Conservative Party,25123,75.9
Truro and Falmouth,KIRKHAM,Jayne Susannah,Labour Party,21331,75.9
Truro and Falmouth,NOLAN,Robert Anthony,Liberal Democrat,8465,75.9
Truro and Falmouth,ODGERS,Duncan Charles,UK Independence Party,897,75.9
Truro and Falmouth,PENNINGTON,Amanda Alice,Green Party,831,75.9

Here is the Python code, which expects the above data in a file called electionresults2017.csv which it reads using csv.DictReader which produces an iterator which I convert to a list and create a pandas data frame object.
The code is also available in the dataviz-sandbox repository at my Bitbucket account.


import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import csv

def chooseColour(desc):
    if desc == "Labour Party":
        return "red"
    elif "Liberal" in desc:
        return "yellow"
    elif "Green" in desc:
        return "green"
    elif "Conservative" in desc:
        return "blue"
    else:
        return "magenta"
    
with open('electionresults2017.csv', 'r') as spamreader:
    dframe = pd.DataFrame(list(csv.DictReader(spamreader)))

consts = set(dframe['Constituency'])
print(consts)
fig = plt.figure()
plt.suptitle("Distribution of Votes in Cornwall\nGeneral Election 8th June 2017")
plt.axis('equal')
plt.xticks([])
plt.yticks([])
for p, c in enumerate(consts):
    # print("Constituency of {}".format(c))
    surnames = dframe.loc[dframe.Constituency == c, ['Surname']].values
    forenames = dframe.loc[dframe.Constituency == c, ['Forenames']].values
    descs = [d[0] for d in dframe.loc[dframe.Constituency == c, ['Description']].values]
    plotcolours = [chooseColour(d) for d in descs]
    forenames = [f for f in forenames]
    forename = [f[0].split()[0] for f in forenames]
    names = [f+" "+s for f,s in zip(forename, surnames)]
    names = [n[0] for n in names]
    votes = dframe.loc[dframe.Constituency == c, ['Votes']].values
    votes1 = [v[0] for v in votes]
    namedescsvotes = [n+"\n"+d+"\n"+v for n,d,v in zip(names, descs, votes1)]

    totalvotes = np.sum(votes, dtype=np.int)
    # print(totalvotes)
    ax = fig.add_subplot(2, 3, p+1)
    ax.axis('equal')
    ax.set_title("{C}: {t} votes cast".format(C=c, t=totalvotes))
    ax.set_xticks([])
    ax.set_yticks([])
    ax.pie(votes, radius = np.sqrt(totalvotes/50000.0), labels=namedescsvotes, colors=plotcolours, autopct='%1.1f%%')

                          
fig2 = plt.figure()
plt.suptitle("Representation of Cornwall in the House of Commons")
plt.axis('equal')
plt.xticks([])
plt.yticks([])
for p, c in enumerate(consts):
    descs = dframe.loc[dframe.Constituency == c, ['Description']].values
    descs = descs[0]
    plotcolours = [chooseColour(d) for d in descs]
    print(descs)
    ax = fig2.add_subplot(2, 3, p+1)
    ax.axis('equal')
    ax.set_title(c)
    ax.set_xticks([])
    ax.set_yticks([])
    ax.pie([1], labels=descs, colors=plotcolours)

plt.show()

And the results:

The votes cast for the various candidates and parties in each of the 6 constituencies covering Cornwall and the Isles of Scilly. George Eustice MP uses his middle name rather than his first name Charles.
In comparison to votes cast, here are the parties represented in the House of Commons for constituencies in Cornwall.

I have also tried out matplotlib_venn. It takes as arguments the keyword subsets, which for the function venn2 expects A and (not B), (not A) and B, and (A and B). Below, voteothers is the number who voted for non-elected candidates, the second is by definition an empty set (those who didn't vote and cast a vote for the winner), and votewinner is those who voted for the winner.

Since Cornwall is a one-party state, the colours can be hard-coded.

import matplotlib.pyplot as plt
import matplotlib_venn as venn
...
    # subsets = (Ab, aB, AB)
    v = venn.venn2(subsets=(voteothers, 0, votewinner), set_colors =('lightgray', 'navy'), set_labels=('Other candidates', winnername))
...


The function venn3 expects a 7 element tuple as below. In this case, A is the electorate, B is those who voted for the winner, and C is those who voted for other candidates.

import matplotlib.pyplot as plt
import matplotlib_venn as venn
...
    # subsets=(Abc, aBc, ABc, abC, AbC, aBC, ABC)
    v = venn.venn3(subsets=(novote, 0, votewinner, 0, voteothers, 0, 0), set_colors =('lightgray', 'blue', 'red'), set_labels=('electoral register', winnername,'Other candidates'))
...

It would be nice to make the zero sets disappear, maybe there is a way to do this in the documentation somewhere.

Sunday, 4 June 2017

Computer troubles and further updates to TaklowKernewek tools

My desktop computer is currently incapacitated, it has for the past day and a half been resizing a NTFS partition after I made the decision, after breaking my QGIS installation while attempting to upgrade it to 2.18, to go back to a dual-boot system rather than a Windows virtual machine running in Ubuntu. Meanwhile I had also broken my netbook because it crashed while trying to upgrade to Ubuntu 17.04. I fixed this by doing a reinstall from a bootable USB stick using the UbuntuMATE iso, formatting only the root partition leaving data in /home intact.

This shouldn't deter anyone from using QGIS, or Ubuntu, just that I was doing odd things with GDAL and kealib, making myself able to use multiband .kea files  in QGIS running with the system environment variables, but use conda to run RSGISLib in Python 3, and also conda to run the European Space Agency's SNAP toolbox to process Sentinel 2 images.
There was a resulting mismatch between different versions of GDAL which caused problems when I tried to update to QGIS 2.18, which failed due to conflicting dependencies, and then trying to revert to 2.14 also failed, so therefore QGIS no longer worked at all.
With my netbook, I had installed so much on it that the root partition was close to full and I think that was what started causing problems.

Fortunately all data is backed up on external drives.

However it is not so easy to do much mapping work on my netbook, although I do now have QGIS 2.18 installed on it, but I have done a bit more on TaklowKernewek, including making the netbook mode work for more of the apps, and developing the mathematics quiz app.

The netbook modes were modified to allow the corpus statistics app, and a couple of others to fit the screen of my netbook (EeePC 1005HA), by adjusting font sizes as well as some input/output box heights.
Inflecting the verb 'covhe' (in SWF Tradycyonal) - Cornish for 'remember'



Inflecting the verb 'covhe' (in SWF Tradycyonal) - Cornish for 'remember'


Basic translation memory using Skeul an Yeth 1 example sentences. The font size of three of the four buttons has been shrunk a little so that labels do not grow bigger than the box itself.

more of the output

some further output of the translation memory


word frequency table for words of 5 or more letters in 'Origo Mundi'. The font sizes are quite small to read to make sure that the boxes do not fall off the bottom of the screen.
The word frequency bar chart has been tweaked as to not use white as a colour, since matplotlib may not always outline the bars.

counting syllables


Transliterating from Kernewek Kemmyn to Standard Written Form. It is possible that goelann should instead go to goolan in SWF, it certainly did in 2008 SWF, and may still do so despite being a multisyllable word.

Mathematics Quiz app

A new difficulty level allow input numbers up to 100, and the GUI has been adjusted to work better on smaller screens (though further work on this may be needed).
The options radio buttons have been consolidated into one column in the GUI

The program now reports back the answer to the previous question that you gave if you were correct as well as if you were wrong. This still looks a little confusing since the question now in the upper box is the second question whereas the answer is for the first. If you get a question right, you get 1 point. The bonus for speed has been reduced compared to earlier versions, to get any speed bonus at all you need to answer within 10 seconds.

'Pur gales' allows the computer to choose numbers up to 100, in this version the addition and subtraction are shown as symbols, due to possible confusion with 'ha' internal to the number such as 'dew ha dew ugens' (42). 'tri ha dew ugens marnas dew ha dew ugens' might be interpreted as 43 - 2 + 40 = 81 rather than 43 - 42 = 1.

There is a need to make some further adjustments to the Tkinter GUI code since at present the widgets aren't filling the window after it is maximized.

Sunday, 28 May 2017

Updating Mars 'Top Trumps' webpages

I have previously created a website for Souness Glacier Top Trumps, based on Colin Souness' work on candidate mid-latitude glaciers on Mars, and my MSc thesis on them.

One of the things covered is whether the object has coverage with the High Resolution Imaging Science Experiment on Mars Reconnaisance Orbiter.

The HiRISE team are continually releasing new images as the Mars Reconnaisance Orbiter is still operating.

I have some horribly obsfucated Python code that can match the shapefile coverage of the Souness objects, to coverage footprint shapefiles, after using QGIS to reproject to a common coordinate system.

I have recently updated my Top Trumps webpages to use shapefiles up to 4th May 2017.

However, the Mars Express tiles remain the same, since the data releases of High-Resolution Stereo Camera process to level 4 (including the derived digital terrain model) are available at NASA Planetary Data System only up to orbits up to 12th Feb 2009.

There do appear to be newer ones recently uploaded at the Freie Universität Berlin website, although they are not in the same format as the ones I used from NASA PDS and they are not in the European Space Agency Planetary Science Archive or NASA PDS yet.

The website currently says:

Archive status (highest released orbit): f836 (levels 2 & 3, PSA), 6567 (level 4, PSA), d795 (level 4 VICAR, HRSCview)

To incorporate these would require a more comprehensive reanalysis of the data, since some more Souness objects would gain digital terrain model coverage and some would gain improved resolution coverage.

An example Souness object which now has links to additional HiRISE footprints from the University of Arizona HiRISE webpage.
I also fix a bug whereby if HiRISE covered all of the bounding box of the 'context' of a Souness object, the png overlay for the HiRISE coverage would show only transparency, due to the way in which ImageMagick was used to colourise the rasterised shapefile.

The convert command was modified from
convert {i} +level-colors black,yellow {o}
to
convert {i} +level-colors ,yellow {o}

so that in the input file,  the value 255 is taken only as the white point, not as both black and white which produced a blank image containing only transparency.

e.g. Souness 83

Souness 83, where the bounding box is wholly covered by the footprint of the HiRISE image PSP_010345_2150.



Saturday, 6 May 2017

Bilingual interface to Cornish Corpus Statistics Python GUI application and switching between Kemmyn and manuscript spelling

As part of my taklow-kernewek tools, I created an application that can do some corpus statistics on Cornish texts, and is configurable at run-time to a certain extent.

I have made a few improvements to the files cornish_corpus.py and corpus_wordfreqGUI.py, which include a bilingual interface, and ability to switch between using Kernewek Kemmyn and manuscript spelling (or at least a reading of such).

To create a switchable bilingual interface, I overhauled the GUI code to make it more object orientated, and created a set of dictionaries where the keys each refer to another dictionary with 2 elements {'en': 'English text', 'kw': 'Cornish text'}.

A button in the GUI then runs a function that changes the interface language, and alters the text in all of the relevant widgets to use that in the new language.

It can also be specified when running corpus_wordfreqGUI.py, at the command line as the -e switch which will launch with English interface.

English interface. The button at the lower left allows switching betweeen the two.

Cornish interface
I have also fixed a bug that happened when there were no words longer than the specified number of letters, and the list of word frequencies is generated. Internally, what happens inside cornish_corpus.py is that the length of the longest word is found, so that the output text is spaced appropriately. Now it checks whether there is an empty list of tuples of (word, frequency) to avoid an indexing error.

The other thing I have done is fix a bug when the manuscript spelling was selected (previously only via command line -m switch, but now also in the GUI, as below). There is a different list of texts available in manuscript vs. Kemmyn, which had previously caused the program to have an index error in some cases.

Unfortunately I still have an issue with TkInter, since when switching between Kemmyn <--> manuscript there is an extra empty space generated, which needs a bit of adjustment to how the widgets pack etc. I got a bit confused when trying to fix it so am leaving it in for now.
Kemmyn (top left) and manuscript (bottom right). These windows have been launched direct from the command line, with the manuscript one launched by "corpus_wordfreqGUI.py -m" to choose the manuscript spelling texts rather than Kemmyn.

Annoying issue with space at the left appearing after switching within the GUI to manuscript spelling.

Update 07/05/17 - Tkinter bug fixed

After spending a while looking at my copy of Programming Python I found the pack_forget() method, which I used to remove the buttons at the lower left (language and manuscript mode switch) while the text choice list is repopulated with new radio buttons, and then the buttons are repacked afterwards.
I also show in the heading above the list texts which mode the program is in.

In Kemmyn mode, showing the most frequent words of at least 5 letters in Passyon agan Arloedh

In manuscript spelling

Thursday, 4 May 2017

Mathematics quiz in Cornish with some improvements

I have made some improvements to the mathematics quiz apposyans_awrgrymGUI.py in my taklow-kernewek tools.

There is now a facility to set a difficulty level, either easy where numbers are always 1-10 and negative answers are suppressed, medium allowing numbers up to 20 and hard allowing numbers up to 40.
The program asks what 10 + 32 is, the answer of course is 42.

The user has answered the question 19 - 33 incorrectly as -4. The program has repeated the previous question in text and figures along with its answer.

The report at the end shows how many questions were answered correctly, and what the points score was. I may well revise the way this calculated since at present it can reward speed more than accuracy (1 point is given for each correct answer and 10-t for speed where t is the number of seconds taken to answer, up to 10 seconds).




Wednesday, 3 May 2017

Mathematics Quiz in Cornish

One of the things I discussed in my talk last year at the Skians conference as possible future developments in software for Cornish is tools or games for learners.

In a first step in that direction, I have programmed a mathematics quiz which asks twenty questions of addition or subtraction, in a Python Tkinter GUI app (or at the command line), to help users practice recognising Cornish numbers.

After entering a number in the box, click on "Profya Gorthyp" or press Enter to submit the answer.

The computer checks the answer for correctness, then shows the time taken for you to submit it, number correct out of questions answered so far, and the total points. One point is awarded for a correct answer, and extra points for speed.

After 16 questions answered, 14 were correctly answered, and total points is 75.4

The end of the quiz after 20 questions.
The code is at my taklow-kernewek repository at Bitbucket. I will likely add a little more to it, including perhaps some different difficulty levels, and maybe some multiplication or division at some point.

Monday, 20 March 2017

Llan50goch

Here is the result of using the regular expressions used in my Python module to segment the longest place name in the UK.

Both forward and backward segmentation are used. Background picture from Astronomy Picture of the Day.

Sunday, 19 March 2017

Syllable segmentation in Welsh

Building on previous work on syllable segmentation, I have now made an initial version of syllable segmentation in Welsh. This currently is implemented within the syllabenn_ranna_kw module, and there is also a test script regexp_test_cy.py at bitbucket.org/davidtreth/taklow-kernewek.


The output of the test script looks like this:
Each syllable is matched by a regular expression using re.findall().The output of this is a list of tuples, one per syllable. The first four elements of the tuple are used if it is a syllable beginning with a consonant, the next three if it is a syllable beginning with a vowel, and the last three if it is a syllable (either CV or V) using a vowel with an diaresis (looks like a German umlaut), which in Welsh forces it to be a separate syllable rather than part of a dipthong with a following vowel.

This is a method, matching backwards from the end of the word.



The main program splitting text into syllables in text mode syllabenn_ranna_kw.py is now able to process Welsh text (possibly erroneously). I will create a TkInter GUI app for it once I have debugged it a bit more.

Here is Mae Hen Wlad Fy Nhadau treated by the program:

Output in line mode

python3 syllabenn_ranna_kw.py --fwd --line --cyregexp maehenwlad.txt

Linenn 1
Mae:1  hen:1  wlad:1  fy:1  nhadau:2  yn:1  annwyl:2  i:1  mi:1  ,:0 
Niver a sylabennow y'n linenn = 11

Linenn 2
Gwlad:1  beirdd:1  a:1  chantorion:3  ,:0  enwogion:3  o:1  fri:1  ;:0 
Niver a sylabennow y'n linenn = 11

Linenn 3
Ei:1  gwrol:1  ryfelwyr:3  ,:0  gwladgarwyr:3  tra:1  mad:1  ,:0 
Niver a sylabennow y'n linenn = 10

Linenn 4
Dros:1  ryddid:2  collasant:3  eu:1  gwaed:1  .:0 
Niver a sylabennow y'n linenn = 8

Linenn 5

Niver a sylabennow y'n linenn = 0

Linenn 6
Gwlad:1  ,:0  gwlad:1  ,:0  pleidiol:2  wyf:1  i'm:1  gwlad:1  .:0 
Niver a sylabennow y'n linenn = 7

Linenn 7
Tra:1  môr:1  yn:1  fur:1  i'r:1  bur:1  hoff:1  bau:1  ,:0 
Niver a sylabennow y'n linenn = 8

Linenn 8
O:1  bydded:2  i'r:1  hen:1  iaith:1  barhau:2  .:0 
Niver a sylabennow y'n linenn = 8

Linenn 9

Niver a sylabennow y'n linenn = 0

Linenn 10
Hen:1  Gymru:2  fynyddig:3  ,:0  paradwys:3  y:1  bardd:1  ,:0 
Niver a sylabennow y'n linenn = 11

Linenn 11
Pob:1  dyffryn:2  ,:0  pob:1  clogwyn:2  ,:0  i'm:1  golwg:2  sydd:1  hardd:1  ;:0 
Niver a sylabennow y'n linenn = 11

Linenn 12
Trwy:1  deimlad:2  gwladgarol:3  ,:0  mor:1  swynol:2  yw:1  si:1 
Niver a sylabennow y'n linenn = 11

Linenn 13
Ei:1  nentydd:2  ,:0  afonydd:3  ,:0  i:1  mi:1  .:0 
Niver a sylabennow y'n linenn = 8

Linenn 14

Niver a sylabennow y'n linenn = 0

Linenn 15
Os:1  treisiodd:2  y:1  gelyn:2  fy:1  ngwlad:1  tan:1  ei:1  droed:1  ,:0 
Niver a sylabennow y'n linenn = 11

Linenn 16
Mae:1  hen:1  iaith:1  y:1  Cymry:2  mor:1  fyw:1  ag:1  erioed:2  ,:0 
Niver a sylabennow y'n linenn = 11

Linenn 17
Ni:1  luddiwyd:2  yr:1  awen:2  gan:1  erchyll:2  law:1  brad:1  ,:0 
Niver a sylabennow y'n linenn = 11

Linenn 18
Na:1  thelyn:2  berseiniol:3  fy:1  ngwlad:1  .:0 
Niver a sylabennow y'n linenn = 8


Selected words in long-form

python3 syllabenn_ranna_kw.py --fwd --cyregexp maehenwlad.txt | more
...
An ger yw: gwrol
Niver a syllabennow yw: 1
Hag yns i: ['gwrol']
S1: GWROL, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4
...
An ger yw: pleidiol
Niver a syllabennow yw: 2
Hag yns i: ['pleid', 'iol']
S1: PLEID, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: iol, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7
...

The word "gwrol" is assumed to have gwr as a consonant cluster, and is thus analysed as 1 syllable rather than 2 it has if w is pronounced as a vowel, which I is the correct Welsh pronunciation of this word, according to recordings of the Welsh national anthem.
Also, "pleidiol" is analysed as two syllables, interpreting the second i as a semi-vowel. It should really be 3 syllables, interpreting it as a vowel, i.e. ["pleid", "i", "ol"].

The Welsh syllable segmentation has a set of regular expressions defined for Welsh, and a subclass of the Syllabenn object, however the Ger object only has the special cases (of abnormal stress) defined for Cornish in the file datageryow.py so most abnormally stressed words will not be picked up.

Appendix, full output of Mae Hen Wlad Fy Nhadau:

python3 syllabenn_ranna_kw.py --fwd --cyregexp maehenwlad.txt
An ger yw: Mae
Niver a syllabennow yw: 1
Hag yns i: ['Mae']
S1: MAE, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: hen
Niver a syllabennow yw: 1
Hag yns i: ['hen']
S1: HEN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: wlad
Niver a syllabennow yw: 1
Hag yns i: ['wlad']
S1: WLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: fy
Niver a syllabennow yw: 1
Hag yns i: ['fy']
S1: FY, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: nhadau
Niver a syllabennow yw: 2
Hag yns i: ['nhad', 'au']
S1: NHAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: au, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5


An ger yw: yn
Niver a syllabennow yw: 1
Hag yns i: ['yn']
S1: YN, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: annwyl
Niver a syllabennow yw: 2
Hag yns i: ['ann', 'wyl']
S1: ANN, VC, hirder = [1, 1], hirder kowal = 2
S2: wyl, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 5


An ger yw: i
Niver a syllabennow yw: 1
Hag yns i: ['i']
S1: I, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: mi
Niver a syllabennow yw: 1
Hag yns i: ['mi']
S1: MI, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Gwlad
Niver a syllabennow yw: 1
Hag yns i: ['Gwlad']
S1: GWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: beirdd
Niver a syllabennow yw: 1
Hag yns i: ['beirdd']
S1: BEIRDD, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: a
Niver a syllabennow yw: 1
Hag yns i: ['a']
S1: a, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: chantorion
Niver a syllabennow yw: 3
Hag yns i: ['chant', 'or', 'ion']
S1: chant, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: OR, VC, hirder = [2, 1], hirder kowal = 3
S3: ion, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 9


An ger yw: enwogion
Niver a syllabennow yw: 3
Hag yns i: ['en', 'wog', 'ion']
S1: en, VC, hirder = [1, 1], hirder kowal = 2
S2: WOG, CVC, hirder = [1, 2, 1], hirder kowal = 4
S3: ion, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 9


An ger yw: o
Niver a syllabennow yw: 1
Hag yns i: ['o']
S1: O, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: fri
Niver a syllabennow yw: 1
Hag yns i: ['fri']
S1: FRI, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Ei
Niver a syllabennow yw: 1
Hag yns i: ['Ei']
S1: EI, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: gwrol
Niver a syllabennow yw: 1
Hag yns i: ['gwrol']
S1: GWROL, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: ryfelwyr
Niver a syllabennow yw: 3
Hag yns i: ['ryf', 'el', 'wyr']
S1: ryf, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: EL, VC, hirder = [2, 1], hirder kowal = 3
S3: wyr, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 9


An ger yw: gwladgarwyr
Niver a syllabennow yw: 3
Hag yns i: ['gwlad', 'gar', 'wyr']
S1: gwlad, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: GAR, CVC, hirder = [1, 2, 1], hirder kowal = 4
S3: wyr, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 10


An ger yw: tra
Niver a syllabennow yw: 1
Hag yns i: ['tra']
S1: TRA, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: mad
Niver a syllabennow yw: 1
Hag yns i: ['mad']
S1: MAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Dros
Niver a syllabennow yw: 1
Hag yns i: ['Dros']
S1: DROS, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: ryddid
Niver a syllabennow yw: 2
Hag yns i: ['rydd', 'id']
S1: RYDD, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: id, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: collasant
Niver a syllabennow yw: 3
Hag yns i: ['coll', 'as', 'ant']
S1: coll, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: AS, VC, hirder = [2, 1], hirder kowal = 3
S3: ant, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 8


An ger yw: eu
Niver a syllabennow yw: 1
Hag yns i: ['eu']
S1: EU, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: gwaed
Niver a syllabennow yw: 1
Hag yns i: ['gwaed']
S1: GWAED, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Gwlad
Niver a syllabennow yw: 1
Hag yns i: ['Gwlad']
S1: GWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: gwlad
Niver a syllabennow yw: 1
Hag yns i: ['gwlad']
S1: GWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: pleidiol
Niver a syllabennow yw: 2
Hag yns i: ['pleid', 'iol']
S1: PLEID, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: iol, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: wyf
Niver a syllabennow yw: 1
Hag yns i: ['wyf']
S1: WYF, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: i'm
Niver a syllabennow yw: 1
Hag yns i: ["i'm"]
S1: I'M, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: gwlad
Niver a syllabennow yw: 1
Hag yns i: ['gwlad']
S1: GWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Tra
Niver a syllabennow yw: 1
Hag yns i: ['Tra']
S1: TRA, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: môr
Niver a syllabennow yw: 1
Hag yns i: ['môr']
S1: MÔR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: yn
Niver a syllabennow yw: 1
Hag yns i: ['yn']
S1: YN, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: fur
Niver a syllabennow yw: 1
Hag yns i: ['fur']
S1: FUR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: i'r
Niver a syllabennow yw: 1
Hag yns i: ["i'r"]
S1: I'R, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: bur
Niver a syllabennow yw: 1
Hag yns i: ['bur']
S1: BUR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: hoff
Niver a syllabennow yw: 1
Hag yns i: ['hoff']
S1: HOFF, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: bau
Niver a syllabennow yw: 1
Hag yns i: ['bau']
S1: BAU, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: O
Niver a syllabennow yw: 1
Hag yns i: ['O']
S1: O, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: bydded
Niver a syllabennow yw: 2
Hag yns i: ['bydd', 'ed']
S1: BYDD, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ed, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: i'r
Niver a syllabennow yw: 1
Hag yns i: ["i'r"]
S1: I'R, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: hen
Niver a syllabennow yw: 1
Hag yns i: ['hen']
S1: HEN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: iaith
Niver a syllabennow yw: 1
Hag yns i: ['iaith']
S1: IAITH, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: barhau
Niver a syllabennow yw: 2
Hag yns i: ['bar', 'hau']
S1: BAR, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: hau, CV, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: Hen
Niver a syllabennow yw: 1
Hag yns i: ['Hen']
S1: HEN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Gymru
Niver a syllabennow yw: 2
Hag yns i: ['Gym', 'ru']
S1: GYM, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ru, CV, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: fynyddig
Niver a syllabennow yw: 3
Hag yns i: ['fyn', 'ydd', 'ig']
S1: fyn, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: YDD, VC, hirder = [2, 1], hirder kowal = 3
S3: ig, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 8


An ger yw: paradwys
Niver a syllabennow yw: 3
Hag yns i: ['par', 'ad', 'wys']
S1: par, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: AD, VC, hirder = [2, 1], hirder kowal = 3
S3: wys, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 9


An ger yw: y
Niver a syllabennow yw: 1
Hag yns i: ['y']
S1: y, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: bardd
Niver a syllabennow yw: 1
Hag yns i: ['bardd']
S1: BARDD, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Pob
Niver a syllabennow yw: 1
Hag yns i: ['Pob']
S1: POB, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: dyffryn
Niver a syllabennow yw: 2
Hag yns i: ['dyff', 'ryn']
S1: DYFF, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ryn, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: pob
Niver a syllabennow yw: 1
Hag yns i: ['pob']
S1: POB, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: clogwyn
Niver a syllabennow yw: 2
Hag yns i: ['clog', 'wyn']
S1: CLOG, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: wyn, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: i'm
Niver a syllabennow yw: 1
Hag yns i: ["i'm"]
S1: I'M, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: golwg
Niver a syllabennow yw: 2
Hag yns i: ['gol', 'wg']
S1: GOL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: wg, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: sydd
Niver a syllabennow yw: 1
Hag yns i: ['sydd']
S1: SYDD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: hardd
Niver a syllabennow yw: 1
Hag yns i: ['hardd']
S1: HARDD, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Trwy
Niver a syllabennow yw: 1
Hag yns i: ['Trwy']
S1: TRWY, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: deimlad
Niver a syllabennow yw: 2
Hag yns i: ['deim', 'lad']
S1: DEIM, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: lad, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: gwladgarol
Niver a syllabennow yw: 3
Hag yns i: ['gwlad', 'gar', 'ol']
S1: gwlad, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: GAR, CVC, hirder = [1, 2, 1], hirder kowal = 4
S3: ol, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 9


An ger yw: mor
Niver a syllabennow yw: 1
Hag yns i: ['mor']
S1: MOR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: swynol
Niver a syllabennow yw: 2
Hag yns i: ['swyn', 'ol']
S1: SWYN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ol, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: yw
Niver a syllabennow yw: 1
Hag yns i: ['yw']
S1: YW, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: si
Niver a syllabennow yw: 1
Hag yns i: ['si']
S1: SI, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Ei
Niver a syllabennow yw: 1
Hag yns i: ['Ei']
S1: EI, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: nentydd
Niver a syllabennow yw: 2
Hag yns i: ['nent', 'ydd']
S1: NENT, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: ydd, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5


An ger yw: afonydd
Niver a syllabennow yw: 3
Hag yns i: ['af', 'on', 'ydd']
S1: af, VC, hirder = [1, 1], hirder kowal = 2
S2: ON, VC, hirder = [2, 1], hirder kowal = 3
S3: ydd, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 7


An ger yw: i
Niver a syllabennow yw: 1
Hag yns i: ['i']
S1: I, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: mi
Niver a syllabennow yw: 1
Hag yns i: ['mi']
S1: MI, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: Os
Niver a syllabennow yw: 1
Hag yns i: ['Os']
S1: OS, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: treisiodd
Niver a syllabennow yw: 2
Hag yns i: ['treis', 'iodd']
S1: TREIS, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: iodd, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: y
Niver a syllabennow yw: 1
Hag yns i: ['y']
S1: y, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: gelyn
Niver a syllabennow yw: 2
Hag yns i: ['gel', 'yn']
S1: GEL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: yn, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: fy
Niver a syllabennow yw: 1
Hag yns i: ['fy']
S1: FY, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: ngwlad
Niver a syllabennow yw: 1
Hag yns i: ['ngwlad']
S1: NGWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: tan
Niver a syllabennow yw: 1
Hag yns i: ['tan']
S1: TAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: ei
Niver a syllabennow yw: 1
Hag yns i: ['ei']
S1: EI, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: droed
Niver a syllabennow yw: 1
Hag yns i: ['droed']
S1: DROED, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Mae
Niver a syllabennow yw: 1
Hag yns i: ['Mae']
S1: MAE, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: hen
Niver a syllabennow yw: 1
Hag yns i: ['hen']
S1: HEN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: iaith
Niver a syllabennow yw: 1
Hag yns i: ['iaith']
S1: IAITH, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: y
Niver a syllabennow yw: 1
Hag yns i: ['y']
S1: y, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2


An ger yw: Cymry
Niver a syllabennow yw: 2
Hag yns i: ['Cym', 'ry']
S1: CYM, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ry, CV, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: mor
Niver a syllabennow yw: 1
Hag yns i: ['mor']
S1: MOR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: fyw
Niver a syllabennow yw: 1
Hag yns i: ['fyw']
S1: FYW, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: ag
Niver a syllabennow yw: 1
Hag yns i: ['ag']
S1: AG, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: erioed
Niver a syllabennow yw: 2
Hag yns i: ['er', 'ioed']
S1: ER, VC, hirder = [2, 1], hirder kowal = 3
S2: ioed, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 6


An ger yw: Ni
Niver a syllabennow yw: 1
Hag yns i: ['Ni']
S1: NI, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: luddiwyd
Niver a syllabennow yw: 2
Hag yns i: ['ludd', 'iwyd']
S1: LUDD, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: iwyd, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7


An ger yw: yr
Niver a syllabennow yw: 1
Hag yns i: ['yr']
S1: YR, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: awen
Niver a syllabennow yw: 2
Hag yns i: ['aw', 'en']
S1: AW, V, hirder = [2], hirder kowal = 2
S2: en, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 4


An ger yw: gan
Niver a syllabennow yw: 1
Hag yns i: ['gan']
S1: GAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: erchyll
Niver a syllabennow yw: 2
Hag yns i: ['erch', 'yll']
S1: ERCH, VC, hirder = [1, 1], hirder kowal = 2
S2: yll, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 4


An ger yw: law
Niver a syllabennow yw: 1
Hag yns i: ['law']
S1: LAW, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: brad
Niver a syllabennow yw: 1
Hag yns i: ['brad']
S1: BRAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4


An ger yw: Na
Niver a syllabennow yw: 1
Hag yns i: ['Na']
S1: Na, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: thelyn
Niver a syllabennow yw: 2
Hag yns i: ['thel', 'yn']
S1: THEL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: yn, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6


An ger yw: berseiniol
Niver a syllabennow yw: 3
Hag yns i: ['bers', 'ein', 'iol']
S1: bers, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: EIN, VC, hirder = [2, 1], hirder kowal = 3
S3: iol, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 9


An ger yw: fy
Niver a syllabennow yw: 1
Hag yns i: ['fy']
S1: FY, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3


An ger yw: ngwlad
Niver a syllabennow yw: 1
Hag yns i: ['ngwlad']
S1: NGWLAD, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

Friday, 17 March 2017

Syllable segmentation now available for Standard Written Form Cornish

I have done some more work on the syllable segmentation module of my taklow-kernewek Python software.

I have added regular expressions to process text in the Standard Written Form of Cornish. These are still under testing and may not correctly process all SWF words.

It looks to me like the SWF specification is not currently available at the Cornish Language Office website, it was accessible via the MAGA website which now redirects to the Cornish Language Office, which doesn't appear to link to the SWF specification PDF.

However it is online here: http://kernowek.net/Specification_Final_Version.pdf and the 2014 revisions are here: https://www.cornwall.gov.uk/media/21486879/swf-review-board-final-report.pdf. The SWF dictionary can be accessed as a PDF (pre-revision spelling) or as a website www.cornishdictionary.org.uk, which will soon be revised by Akademi Kernewek.

Peter Jenkin has recently produced some translations of some Welsh songs into Cornish, in FSS Traditional, which I have used to test my new regular expressions.

As an example, this is the translation of Calon Lân (Colon Lan):

Counting number of syllables per word and in each line. "Tecca" should be spelt "Tecka" I believe which will be recognised as 2 syllables, "Precyous" is 2 syllables in the output reproduced at the end of this post. This screenshot was taken before 'cy' was added as a consonant (used in FSS in place of KK 'sh') in the FSS regular expressions.
Full syllable details. The syllable parts have lengths of either 1 (short) or 2 (long) in FSS rather than 1 (short), 2 (half-long vowel / gemminated consonant), 3 (long vowel) in Kemmyn.

The original text in Welsh is:


Calon lân yn llawn daioni,
Tecach yw na'r lili dlos:
Dim ond calon lân all ganu
Canu'r dydd a chanu'r nos.
Nid wy'n gofyn bywyd moethus,
Aur y byd na'i berlau mân:
Gofyn wyf am galon hapus,
Calon onest, calon lân.

Pe dymunwn olud bydol,
Hedyn buan ganddo sydd;
Golud calon lân, rinweddol,
Yn dwyn bythol elw fydd.

Hwyr a bore fy nymuniad 
Gwyd i'r nef ar adain cân
Ar i Dduw, er mwyn fy Ngheidwad,
Roddi i mi galon lân.
with Peter Jenkin's Cornish translation:

Colon lan yw leun a dhadder,
Tecca es lili precyous:
Ny yll saw colon lan cana -
Cana'n jydh ha cana'n nos.

1. Ny wovynnav bewnans pur es,
Owr an bys na'y berlys mann:
Govyn a wrav colon attes,
Colon onest, colon lan.
   
2. Pythow an bys ma, mar mynnen,
Dhe hasen uskis galsa va;
Lanow colon lan yw prest len
A brenvyth prow bynytha.
   
3. Gorthugher, myttin ow mynnas
A neyj war eskelly can -
Troha Duw, a-barth ow Gwithyas,
A ro dhymmo colon lan.


The output showing the number of syllables in each line is:

Colon:2  lan:1  yw:1  leun:1  a:1  dhadder:2  ,:0 
Niver a sylabennow y'n linenn = 8

Tecca:1  es:1  lili:2  precyous:2  ::0 
Niver a sylabennow y'n linenn = 6

Ny:1  yll:1  saw:1  colon:2  lan:1  cana:2  -:0 
Niver a sylabennow y'n linenn = 8

Cana'n:2  jydh:1  ha:1  cana'n:2  nos:1  .:0 
Niver a sylabennow y'n linenn = 7


Niver a sylabennow y'n linenn = 0

1:0  .:0  Ny:1  wovynnav:3  bewnans:2  pur:1  es:1  ,:0 
Niver a sylabennow y'n linenn = 8

Owr:1  an:1  bys:1  na'y:1  berlys:2  mann:1  ::0 
Niver a sylabennow y'n linenn = 7

Govyn:2  a:1  wrav:1  colon:2  attes:2  ,:0 
Niver a sylabennow y'n linenn = 8

Colon:2  onest:2  ,:0  colon:2  lan:1  .:0 
Niver a sylabennow y'n linenn = 7


Niver a sylabennow y'n linenn = 0

2:0  .:0  Pythow:2  an:1  bys:1  ma:1  ,:0  mar:1  mynnen:2  ,:0 
Niver a sylabennow y'n linenn = 8

Dhe:1  hasen:2  uskis:2  galsa:2  va:1  ;:0 
Niver a sylabennow y'n linenn = 8

Lanow:2  colon:2  lan:1  yw:1  prest:1  len:1 
Niver a sylabennow y'n linenn = 8

A:1  brenvyth:2  prow:1  bynytha:3  .:0 
Niver a sylabennow y'n linenn = 7


Niver a sylabennow y'n linenn = 0

3:0  .:0  Gorthugher:3  ,:0  myttin:2  ow:1  mynnas:2 
Niver a sylabennow y'n linenn = 8

A:1  neyj:1  war:1  eskelly:3  can:1  -:0 
Niver a sylabennow y'n linenn = 7

Troha:2  Duw:1  ,:0  a-barth:2  ow:1  Gwithyas:2  ,:0 
Niver a sylabennow y'n linenn = 8

A:1  ro:1  dhymmo:2  colon:2  lan:1  .:0 
Niver a sylabennow y'n linenn = 7

The word "Tecca" should probably be written "Tecka" in SWF/T, where it will have 2 syllables.

The long-form output showing syllable details is shown below. The lengths of vowels are either long (written as 2 units here) or short (1) in the Standard Written Form, rather than long being 3, half-long 2 and short 1 as in Kemmyn.

An ger yw: Colon
Niver a syllabennow yw: 2
Hag yns i: ['Col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: lan
Niver a syllabennow yw: 1
Hag yns i: ['lan']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: yw
Niver a syllabennow yw: 1
Hag yns i: ['yw']
S1: YW, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: leun
Niver a syllabennow yw: 1
Hag yns i: ['leun']
S1: LEUN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: a
Niver a syllabennow yw: 1
Hag yns i: ['a']
S1: a, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: dhadder
Niver a syllabennow yw: 2
Hag yns i: ['dhadd', 'er']
S1: DHADD, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: er, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: Tecca
Niver a syllabennow yw: 1
Hag yns i: ['Te']
S1: TE, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: es
Niver a syllabennow yw: 1
Hag yns i: ['es']
S1: ES, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: lili
Niver a syllabennow yw: 2
Hag yns i: ['lil', 'i']
S1: LIL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: i, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5

An ger yw: precyous
Niver a syllabennow yw: 2
Hag yns i: ['precy', 'ous']
S1: PRECY, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ous, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: Ny
Niver a syllabennow yw: 1
Hag yns i: ['Ny']
S1: Ny, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: yll
Niver a syllabennow yw: 1
Hag yns i: ['yll']
S1: YLL, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: saw
Niver a syllabennow yw: 1
Hag yns i: ['saw']
S1: SAW, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: colon
Niver a syllabennow yw: 2
Hag yns i: ['col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: lan
Niver a syllabennow yw: 1
Hag yns i: ['lan']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: cana
Niver a syllabennow yw: 2
Hag yns i: ['can', 'a']
S1: CAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: a, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5

An ger yw: Cana'n
Niver a syllabennow yw: 2
Hag yns i: ['Can', "a'n"]
S1: CAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: a'n, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: jydh
Niver a syllabennow yw: 1
Hag yns i: ['jydh']
S1: JYDH, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: ha
Niver a syllabennow yw: 1
Hag yns i: ['ha']
S1: ha, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: cana'n
Niver a syllabennow yw: 2
Hag yns i: ['can', "a'n"]
S1: CAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: a'n, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: nos
Niver a syllabennow yw: 1
Hag yns i: ['nos']
S1: NOS, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: 1
Niver a syllabennow yw: 0
Hag yns i: []
Hirder ger kowal = 0

An ger yw: Ny
Niver a syllabennow yw: 1
Hag yns i: ['Ny']
S1: Ny, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: wovynnav
Niver a syllabennow yw: 3
Hag yns i: ['wov', 'ynn', 'av']
S1: wov, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: YNN, VC, hirder = [1, 1], hirder kowal = 2
S3: av, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 7

An ger yw: bewnans
Niver a syllabennow yw: 2
Hag yns i: ['bewn', 'ans']
S1: BEWN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ans, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: pur
Niver a syllabennow yw: 1
Hag yns i: ['pur']
S1: PUR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: es
Niver a syllabennow yw: 1
Hag yns i: ['es']
S1: ES, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: Owr
Niver a syllabennow yw: 1
Hag yns i: ['Owr']
S1: OWR, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: an
Niver a syllabennow yw: 1
Hag yns i: ['an']
S1: an, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: bys
Niver a syllabennow yw: 1
Hag yns i: ['bys']
S1: BYS, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: na'y
Niver a syllabennow yw: 1
Hag yns i: ["na'y"]
S1: NA'Y, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: berlys
Niver a syllabennow yw: 2
Hag yns i: ['berl', 'ys']
S1: BERL, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: ys, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: mann
Niver a syllabennow yw: 1
Hag yns i: ['mann']
S1: MANN, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: Govyn
Niver a syllabennow yw: 2
Hag yns i: ['Gov', 'yn']
S1: GOV, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: yn, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: a
Niver a syllabennow yw: 1
Hag yns i: ['a']
S1: a, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: wrav
Niver a syllabennow yw: 1
Hag yns i: ['wrav']
S1: WRAV, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: colon
Niver a syllabennow yw: 2
Hag yns i: ['col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: attes
Niver a syllabennow yw: 2
Hag yns i: ['att', 'es']
S1: ATT, VC, hirder = [1, 1], hirder kowal = 2
S2: es, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 4

An ger yw: Colon
Niver a syllabennow yw: 2
Hag yns i: ['Col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: onest
Niver a syllabennow yw: 2
Hag yns i: ['on', 'est']
S1: ON, VC, hirder = [2, 1], hirder kowal = 3
S2: est, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: colon
Niver a syllabennow yw: 2
Hag yns i: ['col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: lan
Niver a syllabennow yw: 1
Hag yns i: ['lan']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: 2
Niver a syllabennow yw: 0
Hag yns i: []
Hirder ger kowal = 0

An ger yw: Pythow
Niver a syllabennow yw: 2
Hag yns i: ['Pyth', 'ow']
S1: PYTH, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ow, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5

An ger yw: an
Niver a syllabennow yw: 1
Hag yns i: ['an']
S1: an, VC, hirder = [2, 1], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: bys
Niver a syllabennow yw: 1
Hag yns i: ['bys']
S1: BYS, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: ma
Niver a syllabennow yw: 1
Hag yns i: ['ma']
S1: ma, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: mar
Niver a syllabennow yw: 1
Hag yns i: ['mar']
S1: mar, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: mynnen
Niver a syllabennow yw: 2
Hag yns i: ['mynn', 'en']
S1: MYNN, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: en, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: Dhe
Niver a syllabennow yw: 1
Hag yns i: ['Dhe']
S1: Dhe, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: hasen
Niver a syllabennow yw: 2
Hag yns i: ['has', 'en']
S1: HAS, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: en, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: uskis
Niver a syllabennow yw: 2
Hag yns i: ['usk', 'is']
S1: USK, VC, hirder = [2, 1], hirder kowal = 3
S2: is, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: galsa
Niver a syllabennow yw: 2
Hag yns i: ['gals', 'a']
S1: GALS, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: a, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 4

An ger yw: va
Niver a syllabennow yw: 1
Hag yns i: ['va']
S1: VA, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: Lanow
Niver a syllabennow yw: 2
Hag yns i: ['Lan', 'ow']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: ow, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5

An ger yw: colon
Niver a syllabennow yw: 2
Hag yns i: ['col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: lan
Niver a syllabennow yw: 1
Hag yns i: ['lan']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: yw
Niver a syllabennow yw: 1
Hag yns i: ['yw']
S1: YW, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: prest
Niver a syllabennow yw: 1
Hag yns i: ['prest']
S1: PREST, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: len
Niver a syllabennow yw: 1
Hag yns i: ['len']
S1: LEN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: A
Niver a syllabennow yw: 1
Hag yns i: ['A']
S1: A, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: brenvyth
Niver a syllabennow yw: 2
Hag yns i: ['bren', 'vyth']
S1: BREN, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: vyth, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7

An ger yw: prow
Niver a syllabennow yw: 1
Hag yns i: ['prow']
S1: PROW, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: bynytha
Niver a syllabennow yw: 3
Hag yns i: ['byn', 'yth', 'a']
S1: byn, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: YTH, VC, hirder = [2, 1], hirder kowal = 3
S3: a, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 7

An ger yw: 3
Niver a syllabennow yw: 0
Hag yns i: []
Hirder ger kowal = 0

An ger yw: Gorthugher
Niver a syllabennow yw: 3
Hag yns i: ['Gorth', 'ugh', 'er']
S1: Gorth, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: UGH, VC, hirder = [2, 1], hirder kowal = 3
S3: er, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 8

An ger yw: myttin
Niver a syllabennow yw: 2
Hag yns i: ['mytt', 'in']
S1: MYTT, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: in, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: ow
Niver a syllabennow yw: 1
Hag yns i: ['ow']
S1: ow, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: mynnas
Niver a syllabennow yw: 2
Hag yns i: ['mynn', 'as']
S1: MYNN, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: as, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: A
Niver a syllabennow yw: 1
Hag yns i: ['A']
S1: A, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: neyj
Niver a syllabennow yw: 1
Hag yns i: ['neyj']
S1: NEYJ, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: war
Niver a syllabennow yw: 1
Hag yns i: ['war']
S1: WAR, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: eskelly
Niver a syllabennow yw: 3
Hag yns i: ['esk', 'ell', 'y']
S1: esk, VC, hirder = [1, 1], hirder kowal = 2
S2: ELL, VC, hirder = [1, 1], hirder kowal = 2
S3: y, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 5

An ger yw: can
Niver a syllabennow yw: 1
Hag yns i: ['can']
S1: CAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4

An ger yw: Troha
Niver a syllabennow yw: 2
Hag yns i: ['Tro', 'ha']
S1: TRO, CV, hirder = [1, 2], hirder kowal = 3
S2: ha, CV, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 5

An ger yw: Duw
Niver a syllabennow yw: 1
Hag yns i: ['Duw']
S1: DUW, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: a-barth
Niver a syllabennow yw: 2
Hag yns i: ['a-', 'barth']
S1: A-, V, hirder = [2], hirder kowal = 2
S2: barth, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 5

An ger yw: ow
Niver a syllabennow yw: 1
Hag yns i: ['ow']
S1: ow, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: Gwithyas
Niver a syllabennow yw: 2
Hag yns i: ['Gwith', 'yas']
S1: GWITH, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: yas, CVC, hirder = [1, 1, 1], hirder kowal = 3
Hirder ger kowal = 7

An ger yw: A
Niver a syllabennow yw: 1
Hag yns i: ['A']
S1: A, V, hirder = [2], hirder kowal = 2
Hirder ger kowal = 2

An ger yw: ro
Niver a syllabennow yw: 1
Hag yns i: ['ro']
S1: RO, CV, hirder = [1, 2], hirder kowal = 3
Hirder ger kowal = 3

An ger yw: dhymmo
Niver a syllabennow yw: 2
Hag yns i: ['dhymm', 'o']
S1: DHYMM, CVC, hirder = [1, 1, 1], hirder kowal = 3
S2: o, V, hirder = [1], hirder kowal = 1
Hirder ger kowal = 4

An ger yw: colon
Niver a syllabennow yw: 2
Hag yns i: ['col', 'on']
S1: COL, CVC, hirder = [1, 2, 1], hirder kowal = 4
S2: on, VC, hirder = [1, 1], hirder kowal = 2
Hirder ger kowal = 6

An ger yw: lan
Niver a syllabennow yw: 1
Hag yns i: ['lan']
S1: LAN, CVC, hirder = [1, 2, 1], hirder kowal = 4
Hirder ger kowal = 4