British English (Might be helpful for others)

I’ve seen a few posts about the spelling of words for British English.

While I have not been able to consistently get the AI to give the results I needed, I put together a function to replace words in the resulting text. I used a regex with a word list. Essentially, I look for words in the list, and swap for their alternate spelling. The regex needs a \b at both ends (so it only gets whole words)

You also need to handle the upper and lower case to make it match the original text. Here is the word list

acknowledgement acknowledgment
aeroplane airplane
aesthetic esthetic
ageing aging
aluminium aluminum
amoeba ameba
anaemia anemia
anaesthesia anesthesia
analyse analyze
analogue analog
annexe annex
apologise apologize
archaeology archeology
armour armor
arse ass
artefact artifact
authorise authorize
axe ax
behaviour behavior
broncho bronco
caesium cesium
chamomile camomile
cancelled canceled
carburettor carburetor
catalogue catalog
centre center
cheque check
chequer checker
cypher cipher
civilise civilize
colonise colonize
colonisation colonization
colour color
cosy cozy
counsellor counselor
counselling counseling
connexion connection
defence defense
demagogue demagog
dialled dialed
dialler dialer
dialogue dialog
diarrhoea diarrhea
disc disk
distil distill
doughnut donut
draught draft
dreamt dreamed
emphasise emphasize
encyclopaedia encyclopedia
enrolment enrollment
equalling equaling
endeavour endeavor
enquire inquire
favourite favorite
favour favor
faeces feces
fibre fiber
flaky flakey
foetid fetid
foetal fetal
foetus fetus
flautist flutist
flavour flavor
fulfil fulfill
furore furor
fuelling fueling
gaol jail
generalise generalize
glycerine glycerin
grey gray
gynaecology gynecology
haemophilia hemophilia
haematology hematology
haem heme
harbour harbor
harmonise harmonize
harmonisation harmonization
homologue homolog
honour honor
humour humor
industrialise industrialize
instalment installment
italicise italicize
in side inside.
jewellery jewelry
judgement judgment
kerb curb
kilometre kilometer
labour labor
led lead
leapt leaped
learnt learned
licence license
liquorice licorice
light lite
litre liter
lodgment lodgement
manoeuvre maneuver
marvellous marvelous
meagre meager
metre meter
modelling modeling
milliard billion
mould mold
mollusc mollusk
moult molt
mum mom
monologue monolog
moustache mustache
moisturiser moisturizer
neighbour neighbor
oenology enology
oesophagus esophagus
oestrogen estrogen
odour odor
offence offense
omelette omelet
organisation organization
orthologue ortholog
orthopaedic orthopedic
paediatric pediatric
paedophile pedophile
paralyse paralyze
parlour parlor
pedagogue pedagog
plough plow
practise practice
pretence pretense
prise prize
programme program
pyjamas pajamas
quarrelled quarreled
quarrelling quarreling
realise realize
realisation realization
rigour rigor
routeing routing
rumour rumor
saviour savior
savoury savory
sceptic skeptic
signalling signaling
skilful skillful
speciality specialty
spelt spelled
spoilt spoiled
storey story
sulphur sulfur
theatre theater
tyre tire
tranquillity tranquility
travelled traveled
traveller traveler
travelling traveling
tumour tumor
urbanisation urbanization
valour valor
vender vendor
victual vittle
vigour vigor
wintery wintry
whisky whiskey
woollen woolen
yoghurt yogurt
acknowledgements acknowledgments
aeroplanes airplanes
aesthetics esthetics
amoebae amebae
analogues analogs
annexes annexes
apologises apologizes
armours armors
arses asses
artefacts artifacts
authorises authorizes
axes axes
behaviours behaviors
bronchos broncos
carburettors carburetors
catalogues catalogs
centres centers
cheques checks
chequers checkers
cyphers ciphers
civilises civilizes
colonises colonizes
colours colors
counsellors counselors
connexions connections
defences defenses
demagogues demagogs
diallers dialers
dialogues dialogs
discs disks
distils distills
doughnuts donuts
draughts drafts
emphasises emphasizes
encyclopaedias encyclopedias
enrolments enrollments
endeavours endeavors
enquires inquires
favourites favorites
favours favors
fibres fibers
foetuses fetuses
flautists flutists
flavours flavors
fulfils fulfills
furores furors
gaols jails
generalises generalizes
harbours harbors
harmonises harmonizes
homologues homologs
honours honors
humours humors
instalments installments
italicises italicizes
judgements judgments
kerbs curbs
kilometres kilometers
labours labors
licences licenses
litres liters
lodgments lodgements
manoeuvres maneuvers
metres meters
milliards billions
moulds molds
molluscs mollusks
moults molts
mums moms
monologues monologs
neighbours neighbors
odours odors
offences offenses
omelettes omelets
organisations organizations
orthologues orthologs
paralyses paralyzes
parlours parlors
pedagogues pedagogs
ploughs plows
practises practices
prises prizes
programmes programs
quarrels quarrels
realises realizes
rigours rigors
rumours rumors
saviours saviors
sceptics skeptics
signallings signalings
specialities specialties
storeys stories
sulphurs sulfurs
theatres theaters
tyres tires
travellers travelers
tumours tumors
urbanisations urbanizations
vigours vigors
woollens woolens

And here is a C# function that you could modify (it handles the upper and lowercase etc)

    public static string SwapWords(string sourcetext, string fromword, string toword)
    {
        return Regex.Replace(sourcetext, $@"\b{fromword}\b", match =>
        {
            string word = match.Value;
            if (char.IsUpper(word[0]))
            {
                if (word.ToUpper() == word)
                {
                    return toword.ToUpper(); // All caps
                }
                return char.ToUpper(toword[0]) + toword.Substring(1); // First letter capitalized
            }
            return toword; // All lower case
        }, RegexOptions.IgnoreCase);
    }

I hope this can be helpful to others

3 Likes

Sharing is caring. Thanks for thinking of us.

How you been? Well, I hope!

1 Like

Thank you for the list! I happened to notice that the entry for “axes” is the same in both columns.

1 Like

Thanks for pointing that out. I’ll remove it from my list too

I’ve been busy with lots of AI side projects - some work out, and others don’t. I see your rpg project is getting lots of new features. I hope you are well too.