1
0
forked from GitHub/gf-core

module Markup for marking up subphrases with html tags (or other things). Implemented for Eng and Swe so far.

This commit is contained in:
aarne
2014-02-11 15:42:17 +00:00
parent be31b52e07
commit 4c26fc80ee
10 changed files with 115 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ abstract Lang =
Lexicon
,Construction --- could be compiled here, but not in concretes, as they call Syntax and Grammar
,Documentation
,Markup
** {
flags startcat=Phr ;
} ;

View File

@@ -0,0 +1,25 @@
abstract MarkHTML = {
-- HTML markup to be used in Markup.gf. Will have a common implementation for all languages.
-- AR 11/2/2014
cat
Mark ;
fun
i_Mark : Mark ;
b_Mark : Mark ;
ul_Mark : Mark ;
li_Mark : Mark ;
h1_Mark : Mark ;
h2_Mark : Mark ;
table_Mark : Mark ;
tr_Mark : Mark ;
td_Mark : Mark ;
p_Mark : Mark ;
a_Mark : String -> Mark ;
stringMark : String -> String -> Mark ; -- make your own markup
}

View File

@@ -0,0 +1,20 @@
abstract Markup = Cat, MarkHTML ** {
-- Adding markup to sentences and their parts. By default both start and end tags.
-- For instance
--
-- MarkupNP boldMarkup everything_NP ==> <b> everything </b>
--
-- AR 11/2/2014
fun
MarkupCN : Mark -> CN -> CN ;
MarkupNP : Mark -> NP -> NP ;
MarkupAP : Mark -> AP -> AP ;
MarkupAdv : Mark -> Adv -> Adv ;
MarkupS : Mark -> S -> S ;
MarkupUtt : Mark -> Utt -> Utt ;
MarkupPhr : Mark -> Phr -> Phr ;
MarkupText : Mark -> Text -> Text ;
}