ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* (critical edition) text reducing command
@ 2013-12-06 13:41 Pablo Rodriguez
  0 siblings, 0 replies; only message in thread
From: Pablo Rodriguez @ 2013-12-06 13:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Thomas, Luigi and Hans,

I have a feature suggestion that might be interesting to implement for
critical editions.

Here is my code sample:

\mainlanguage[la]
\unexpanded\def\doVariant#1#2#3%
   {\startlinenote[#1]{#2] #3}#2%
   \prewordbreak\stoplinenote[#1]}

\newcounter\VarCounter
\unexpanded\def\Variant
   {\doglobal\increment\VarCounter
    \normalexpanded{\doVariant{Varia:\VarCounter}}}

\starttext
\startlinenumbering
Gallia est omnis divisa in partes tres, \Variant{quarum unam incolunt
Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli
appellantur}{{\em om} X}.
\blank
Gallia est omnis divisa in partes tres, \startlinenote[firstone]{quarum
... appelantur] {\em om} X}quarum unam incolunt Belgae, aliam Aquitani,
tertiam qui ipsorum lingua Celtae, nostra Galli
appellantur\stoplinenote[firstone].
\stoplinenumbering
\stoptext

To automatically get the text reduced to the form that appears in the
second paragraph, there should be a command for that.

In this text reduction, one should be able to set how many words (no
punctuation marks) should contain the text to be reduced, how many
words should be printed before the separator, how many words should be
printed after the separator and which is the separator.

I don’t know whether this could be a good way of coding it:

\definetextreduction[caesarcompressed]
\setuptextreduction[caesarcompressed][totallength=5, wordsbeforesep=1,
wordsaftersep=1, separator={...}]

I think this feature may be especially relevant with TEI encoded texts.

There is a shortcoming on my proposal: only words have to be
counted and added to the output and punctuation signs should be
ignored. But this is clearly limited, since exclamation and question
marks (Spanish has both opening and closing marks for exclamation and
question: ¿? ¡!) should not be counted as words (total, after or
before), but they should be included in the reduced version of the
text. The same happens with apostrophe. And I wonder whether the same
rules should be applied to quotation marks.

There is a special case: the semicolon is also used as question mark
in Greek. I think it is clear than the semicolon should be removed for
the reduced text in other languages than Greek, but it should be
included (not counted) in Greek reduced texts.

I hope the proposal and the issues it might arise are clear. Please, ask
if they aren’t.

Many thanks for your excellent work,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-06 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-06 13:41 (critical edition) text reducing command Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).