mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
commands for displaying transliteration tables
This commit is contained in:
@@ -22,6 +22,7 @@ import GF.Data.ErrM ----
|
||||
import PGF.ExprSyntax (readExp)
|
||||
import GF.Command.Abstract
|
||||
import GF.Text.Lexing
|
||||
import GF.Text.Transliterations
|
||||
|
||||
import GF.Data.Operations
|
||||
|
||||
@@ -301,21 +302,27 @@ allCommands pgf = Map.fromList [
|
||||
"string processing functions in the order given in the command line",
|
||||
"option list. Thus 'ps -f -g s' returns g (f s). Typical string processors",
|
||||
"are lexers and unlexers, but also character encoding conversions are possible.",
|
||||
"The unlexers preserve the division of their input to lines."
|
||||
"The unlexers preserve the division of their input to lines.",
|
||||
"To see transliteration tables, use command ut."
|
||||
],
|
||||
examples = [
|
||||
"l (EAdd 3 4) | ps -code -- linearize code-like output",
|
||||
"ps -lexer=code | p -cat=Exp -- parse code-like input",
|
||||
"gr -cat=QCl | l | ps -bind -to_utf8 -- linearization output from LangFin",
|
||||
"ps -from_utf8 \"jag ?r h?r\" | p -- parser in LangSwe in UYF8 terminal"
|
||||
"ps -from_utf8 \"jag ?r h?r\" | p -- parser in LangSwe in UTF8 terminal",
|
||||
"ps -to_devanagari -to_utf8 \"A-p\" -- show Devanagari in UTF8 terminal"
|
||||
],
|
||||
exec = \opts -> return . fromString . stringOps opts . toString,
|
||||
options = [
|
||||
("bind","bind tokens separated by Prelude.BIND, i.e. &+"),
|
||||
("from_devanagari","from unicode to GF Devanagari transliteration"),
|
||||
("from_thai","from unicode to GF Thai transliteration"),
|
||||
("from_utf8","decode from utf8"),
|
||||
("lextext","text-like lexer"),
|
||||
("lexcode","code-like lexer"),
|
||||
("lexmixed","mixture of text and code (code between $...$)"),
|
||||
("to_devanagari","from GF Devanagari transliteration to unicode"),
|
||||
("to_thai","from GF Thai transliteration to unicode"),
|
||||
("to_utf8","encode to utf8"),
|
||||
("unlextext","text-like unlexer"),
|
||||
("unlexcode","code-like unlexer"),
|
||||
@@ -370,6 +377,18 @@ allCommands pgf = Map.fromList [
|
||||
("number","the maximum number of questions")
|
||||
]
|
||||
}),
|
||||
("ut", emptyCommandInfo {
|
||||
longname = "unicode_table",
|
||||
synopsis = "show a transliteration table for a unicode character set",
|
||||
exec = \opts arg -> do
|
||||
let t = concatMap prOpt (take 1 opts)
|
||||
let out = maybe "no such transliteration" characterTable $ transliteration t
|
||||
return $ fromString out,
|
||||
options = [
|
||||
("devanagari","Devanagari"),
|
||||
("thai", "Thai")
|
||||
]
|
||||
}),
|
||||
("wf", emptyCommandInfo {
|
||||
longname = "write_file",
|
||||
synopsis = "send string or tree to a file",
|
||||
|
||||
Reference in New Issue
Block a user