Page MenuHomeWickedGov Phorge

roman.foma
No OneTemporary

Size
780 B
Referenced Files
None
Subscribers
None

roman.foma

# Helper functions for preventing conversion of Roman Numerals.
# requires: brackets.foma
# From PHP: Roman numerals
# Note that this matches the empty string!
define ROMAN M^{0,4} [ C[D|M]|(D)C^{0,3} ] [ X[L|C]|(L)X^{0,3} ] [ I[V|X]|(V)I^{0,3} ];
# This will add brackets around roman numerals; the BREAK parameter should be
# a regex for a "not a word" character. (Roughly [^\w], but it varies a bit
# for different scripts.)
define BRACKETROMAN(break) [
[ROMAN & ?+] @-> "[[" ... "]]" || [ break | .#. ] _ [ .#. | break ]
];
# Variant originally from LanguageCrh: remove the brackets if it's a single
# character followed by a period.
define BRACKETROMAN'CRH(break) BRACKETROMAN(break) .o. [
"[[" -> 0 || _ \BRACKETS "]]" "." ,,
"]]" -> 0 || "[[" \BRACKETS _ "."
];

File Metadata

Mime Type
text/plain
Expires
Oct 5 2026, 10:29 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2e/c1/b4aeaeefff21d38e4f340d973560
Default Alt Text
roman.foma (780 B)

Event Timeline