Couldn't seem to
make it work that way, but to be honest my experience with both grep
and regular expressions in general is limited.
But
the following subroutine seems to do the trick. Took less time than I
thought. Is there an easier way to do this?
on removeLigaturesFromString(inputStringWithLigatures)
set characterList to characters of inputStringWithLigatures
set charactersWithoutLigatures to {}
repeat
with char from 1
to count of
characterList
if
item char of characterList is equal to
"Ꜳ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"A"}
else
if item char of characterList is equal to
"ꜳ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"a"}
else
if item char of characterList is equal to
"Æ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"E"}
else
if item char of characterList is equal to
"æ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"e"}
else
if item char of characterList is equal to
"Ꜵ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"O"}
else
if item char of characterList is equal to
"ꜵ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"o"}
else
if item char of characterList is equal to
"Ꜷ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"U"}
else
if item char of characterList is equal to
"ꜷ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"u"}
else
if item char of characterList is equal to
"Ꜹ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"V"}
else
if item char of characterList is equal to
"ꜹ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"v"}
else
if item char of characterList is equal to
"Ꜻ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"V"}
else
if item char of characterList is equal to
"ꜻ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"v"}
else
if item char of characterList is equal to
"Ꜽ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"A"} & {"Y"}
else
if item char of characterList is equal to
"ꜽ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"a"} & {"y"}
else
if item char of characterList is equal to
"ff"
then
set charactersWithoutLigatures to charactersWithoutLigatures & {"f"} & {"f"}
else
if item char of characterList is equal to
"ffi"
then
set charactersWithoutLigatures to charactersWithoutLigatures & {"f"} & {"f"} & {"i"}
else
if item char of characterList is equal to
"ffl"
then
set charactersWithoutLigatures to charactersWithoutLigatures & {"f"} & {"f"} & {"l"}
else
if item char of characterList is equal to
"fi" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"f"} & {"i"}
else
if item char of characterList is equal to
"fl" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"f"} & {"l"}
else
if item char of characterList is equal to
"Œ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"O"} & {"E"}
else
if item char of characterList is equal to
"œ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"o"} & {"e"}
else
if item char of characterList is equal to
"Ꝏ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"O"} & {"O"}
else
if item char of characterList is equal to
"st"
then
set charactersWithoutLigatures to charactersWithoutLigatures & {"s"} & {"t"}
else
if item char of characterList is equal to
"Ꜩ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"T"} & {"Z"}
else
if item char of characterList is equal to
"ꜩ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"t"} & {"z"}
else
if item char of characterList is equal to
"ᵫ"
then
set charactersWithoutLigatures to charactersWithoutLigatures & {"u"} & {"e"}
else
if item char of characterList is equal to
"Ꝡ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"V"} & {"Y"}
else
if item char of characterList is equal to
"ꝡ" then
set charactersWithoutLigatures to charactersWithoutLigatures & {"v"} & {"y"}
else
set charactersWithoutLigatures to charactersWithoutLigatures & item char of
characterList
end
if
end
repeat
set stringWithLigaturesRemoved to ((items of charactersWithoutLigatures) as string)
return stringWithLigaturesRemoved
end removeLigaturesFromString
removeLigaturesFromString(inputStringWithLigatures)