diff options
author | Norbert Preining <preining@logic.at> | 2013-05-27 02:17:53 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2013-05-27 02:17:53 +0000 |
commit | b47d2dedb7926d63f081bbe3fad758575c9dbf5b (patch) | |
tree | 25cc044a2f937013430af1cc5a12c026a899b10c | |
parent | b2f9bba8d6a7ed504466bc800297e98328dc38f5 (diff) |
spelling update 5/27
git-svn-id: svn://tug.org/texlive/trunk@30715 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/luatex/spelling/CHANGES | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/spelling/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/spelling/spelling-doc.pdf | bin | 127173 -> 128505 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/spelling/spelling-doc.tex | 85 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-main.lua | 13 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-recurse.lua | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-stage-1.lua | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-stage-2.lua | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-stage-3.lua | 2 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/spelling/spelling-stage-4.lua | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/spelling/spelling.sty | 4 |
11 files changed, 66 insertions, 58 deletions
diff --git a/Master/texmf-dist/doc/luatex/spelling/CHANGES b/Master/texmf-dist/doc/luatex/spelling/CHANGES index 383a64dcb0f..b96745410fb 100644 --- a/Master/texmf-dist/doc/luatex/spelling/CHANGES +++ b/Master/texmf-dist/doc/luatex/spelling/CHANGES @@ -2,6 +2,14 @@ This material is subject to the LaTeX Project Public License. See <http://www.latex-project.org/lppl/> for the details of that license. +### v0.41 (2013-05-25) + +Fixes: + +* Fixed compatibility issue with LuaTeX 0.70.2 that caused text output + file written to be emtpy. + + ### v0.4 (2013-05-23) New features: diff --git a/Master/texmf-dist/doc/luatex/spelling/README b/Master/texmf-dist/doc/luatex/spelling/README index fa268331678..a5f2ee41583 100644 --- a/Master/texmf-dist/doc/luatex/spelling/README +++ b/Master/texmf-dist/doc/luatex/spelling/README @@ -7,8 +7,8 @@ This material is subject to the LaTeX Project Public License. See Package name: spelling Summary description: support for spell-checking of LuaTeX documents -Version: v0.4 -Date: 2013-05-23 +Version: v0.41 +Date: 2013-05-25 License: [LPPL v1.3c](http://www.latex-project.org/lppl/lppl-1-3c.html) Maintenance status: maintained Current maintainer: Stephan Hennig, <sh2d@arcor.de> diff --git a/Master/texmf-dist/doc/luatex/spelling/spelling-doc.pdf b/Master/texmf-dist/doc/luatex/spelling/spelling-doc.pdf Binary files differindex 442195e87a6..527d70d6acf 100644 --- a/Master/texmf-dist/doc/luatex/spelling/spelling-doc.pdf +++ b/Master/texmf-dist/doc/luatex/spelling/spelling-doc.pdf diff --git a/Master/texmf-dist/doc/luatex/spelling/spelling-doc.tex b/Master/texmf-dist/doc/luatex/spelling/spelling-doc.tex index 88b9a74c5c7..79e59b2aec4 100644 --- a/Master/texmf-dist/doc/luatex/spelling/spelling-doc.tex +++ b/Master/texmf-dist/doc/luatex/spelling/spelling-doc.tex @@ -68,7 +68,7 @@ basicstyle=\ttfamily, \newcommand*{\lpie}{\latinphrase{i.\,e.}\xspace} \begin{document} \author{Stephan Hennig\thanks{sh2d@arcor.de}} -\title{\pkg\thanks{This document describes the \pkg\ package v0.4.}} +\title{\pkg\thanks{This document describes the \pkg\ package v0.41.}} \maketitle @@ -261,13 +261,12 @@ stripped string against the Lua string pattern |^%a%a%a$| via function |unicode.utf8.find| from the Selene Unicode library. The latter function is a \acr{utf-8} capable version of Lua's built-in function |string.find|. It returns |nil| (a false value) if there has been no -match and a number (a true value) if there has been a match. The string -|%a| represents a string class matching a single letter. Characters |^| -and |$| are anchors for the beginning and the end of the string in -question. Note, the pattern |%a%a%a| without anchors would match -any string which contains \emph{at least} three letters in a row. More -information about Lua string patterns can be found in the Lua reference -manual% +match and a number (a true value) if there has been a match. The +pattern |%a| represents a character class matching a single letter. +Characters |^| and |$| are anchors for the beginning and the end of the +string in question. Note, pattern |%a%a%a| without anchors would match +any string containing three letters in a row. More information about +Lua string patterns can be found in the Lua reference manual% \footnote{\url{http://www.lua.org/manual/5.2/manual.html\#6.4}}% % , the Selene Unicode library documentation% @@ -286,7 +285,8 @@ end \end{lstlisting} \autoref{lst:mr-double-punctuation} shows a rule matching all ‘words’ -containing double punctuation. +containing double punctuation. Note, how the raw string is examined +instead of the stripped one. \begin{lstlisting}[style=Lua, float, label=lst:mr-double-punctuation, caption={Matching double punctuation.}] function double_punctuation(raw, stripped) @@ -296,11 +296,11 @@ end The rule in \autoref{lst:mr-bibtex-alpha} combines the results of three string searches to match bibliographic references as generated by the -Bib\TeX\ \emph{alpha} style. +Bib\TeX\ style \emph{alpha}. -\begin{lstlisting}[style=Lua, float, label=lst:mr-bibtex-alpha, caption={Matching references generated by the Bib\TeX\ alpha style.}] +\begin{lstlisting}[style=Lua, float, label=lst:mr-bibtex-alpha, caption={Matching references generated by the Bib\TeX\ style \emph{alpha}.}] function bibtex_alpha(raw, stripped) - return unicode.utf8.find(stripped, '^%u%l%l%d%d$') + return unicode.utf8.find(stripped, '^%u%l%l?%d%d$') or unicode.utf8.find(stripped, '^%u%u%u?%u?%d%d$') or unicode.utf8.find(stripped, '^%u%u%u%+%d%d$') end @@ -327,7 +327,7 @@ document via \spellingmatchrules{myproject.rules} \end{lstlisting} -\begin{lstlisting}[style=Lua, float=p, label=lst:mr-module, caption={A module containing two bad and one good match rule.}] +\begin{lstlisting}[style=Lua, float=p, label=lst:mr-module, caption={A Lua module containing two bad and one good match rule.}] -- Module table. local M = {} @@ -336,9 +336,11 @@ local unicode = require('unicode') -- Add short-cut. local Ufind = unicode.utf8.find +-- Local function matching three letter words. local function three_letter_words(raw, stripped) return Ufind(stripped, '^%a%a%a$') end +-- Make this a bad rule. M.bad_rule_three_letter_words = three_letter_words local function double_punctuation(raw, stripped) @@ -347,12 +349,13 @@ end M.bad_rule_double_punctuation = double_punctuation local function bibtex_alpha(raw, stripped) - return Ufind(stripped, '^%u%l%l%d%d$') + return Ufind(stripped, '^%u%l%l?%d%d$') or Ufind(stripped, '^%u%u%u?%u?%d%d$') or Ufind(stripped, '^%u%u%u%+%d%d$') end M.good_rule_bibtex_alpha = bibtex_alpha +-- Export module table. return M \end{lstlisting} @@ -365,36 +368,30 @@ entry in the list of good spellings takes precedence over any user-supplied bad rule. Likewise, any user-supplied good rule takes precedence over an entry in the list of bad spellings. -Some final remarks on match rules: - -\begin{itemize} - -\item It must be stressed that the boolean return value of a match rule - \emph{does not} indicate whether a spelling is bad or good, but - whether a word matches a certain rule or not. Whether it's a bad or a - good spelling, depends on the name of the match rule in the module - table. - -\item When written without care, match rules can easily produce false - positives as well as false negatives. While false positives in bad - rules and false negatives in good rules can easily be spotted due to - the unexpected highlighting of words, the other cases are more - problematic. To avoid all kinds of false results, match rules should - be stated as specific as possible. - -\item Match rules are only called upon the first occurrence of a - spelling in a document. The information, whether a spelling needs to - be highlighted, is stored in a cache table. Subsequent occurrences of - a spelling just need a table look-up to determine highlighting status. - For that reason, it is safe to do relatively expensive operations - within a match rule without affecting compilation time too much. - Nevertheless, match rules should be stated as efficient as possible.% - \footnote{Some Lua performance tips can be found in the book \emph{Lua - Programming Gems} by Figueiredo, Celes and Ierusalimschy - \emph{(eds.)}, 2008, ch.~2. That chapter is also available online - at \url{http://www.lua.org/gems/}.} - -\end{itemize} +\paragraph{Some final remarks on match rules} It must be stressed that +the boolean return value of a match rule \emph{does not} indicate +whether a spelling is bad or good, but whether a word matches a certain +rule or not. Whether it's a bad or a good spelling, depends on the name +of the match rule in the module table. + +Match rules are only called upon the first occurrence of a spelling in a +document. The information, whether a spelling needs to be highlighted, +is stored in a cache table. Subsequent occurrences of a spelling just +need a table look-up to determine highlighting status. For that reason, +it is safe to do relatively expensive operations within a match rule +without affecting compilation time too much. Nevertheless, match rules +should be stated as efficient as possible.% +\footnote{Some Lua performance tips can be found in the book \emph{Lua + Programming Gems} by Figueiredo, Celes and Ierusalimschy + \emph{(eds.)}, 2008, ch.~2. That chapter is also available online at + \url{http://www.lua.org/gems/}.} + +When written without care, match rules can easily produce false +positives as well as false negatives. While false positives in bad +rules and false negatives in good rules can easily be spotted due to the +unexpected highlighting of words, the other cases are more problematic. +To avoid all kinds of false results, match rules should be stated as +specific as possible. \subsection{Highlighting spellling mistakes} diff --git a/Master/texmf-dist/scripts/spelling/spelling-main.lua b/Master/texmf-dist/scripts/spelling/spelling-main.lua index 937054732e2..8aaecbda0cf 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-main.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-main.lua @@ -16,7 +16,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- @@ -25,8 +25,8 @@ if luatexbase.provides_module then luatexbase.provides_module( { name = 'spelling', - date = '2013/05/23', - version = '0.4', + date = '2013/05/25', + version = '0.41', description = 'support for spell-checking of LuaTeX documents', author = 'Stephan Hennig', licence = 'LPPL ver. 1.3c', @@ -165,8 +165,9 @@ PKG_spelling = {} --- Determine unique IDs for user-defined whatsit nodes used by this -- package. Package luatexbase provides user-defined whatsit node ID -- allocation since version v0.6 (TL 2013). For older package versions, --- we start allocating at an arbitrary hard-coded value of 35**8 --- (ca. 2**41). +-- we start allocating at an arbitrary hard-coded value of 13**8 +-- (ca. 2**30). Note, for compatibility with LuaTeX 0.70.2, the value +-- must be less than 2^31. -- -- @return Table mapping names to IDs. local function __allocate_whatsit_ids() @@ -176,7 +177,7 @@ local function __allocate_whatsit_ids() ids.start_tag = luatexbase.new_user_whatsit_id('start_tag', 'spelling') ids.end_tag = luatexbase.new_user_whatsit_id('end_tag', 'spelling') else - local uid = 35^8 + local uid = 13^8 ids.start_tag = uid + 1 ids.end_tag = uid + 2 end diff --git a/Master/texmf-dist/scripts/spelling/spelling-recurse.lua b/Master/texmf-dist/scripts/spelling/spelling-recurse.lua index 4de903db36b..70b48eea2b8 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-recurse.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-recurse.lua @@ -18,7 +18,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- -- @trick Prevent LuaDoc from looking past here for module description. --[[ Trick LuaDoc into entering 'module' mode without using that command. diff --git a/Master/texmf-dist/scripts/spelling/spelling-stage-1.lua b/Master/texmf-dist/scripts/spelling/spelling-stage-1.lua index 0f4afe9bb69..c54bac98eb8 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-stage-1.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-stage-1.lua @@ -16,7 +16,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- -- @trick Prevent LuaDoc from looking past here for module description. --[[ Trick LuaDoc into entering 'module' mode without using that command. diff --git a/Master/texmf-dist/scripts/spelling/spelling-stage-2.lua b/Master/texmf-dist/scripts/spelling/spelling-stage-2.lua index 1a397217a16..c7cb98f1f2b 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-stage-2.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-stage-2.lua @@ -21,7 +21,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- -- @trick Prevent LuaDoc from looking past here for module description. --[[ Trick LuaDoc into entering 'module' mode without using that command. diff --git a/Master/texmf-dist/scripts/spelling/spelling-stage-3.lua b/Master/texmf-dist/scripts/spelling/spelling-stage-3.lua index 436fe6422fd..613e6af995e 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-stage-3.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-stage-3.lua @@ -25,7 +25,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- -- @trick Prevent LuaDoc from looking past here for module description. --[[ Trick LuaDoc into entering 'module' mode without using that command. diff --git a/Master/texmf-dist/scripts/spelling/spelling-stage-4.lua b/Master/texmf-dist/scripts/spelling/spelling-stage-4.lua index ab4fabb22f7..ce027c8c50c 100755 --- a/Master/texmf-dist/scripts/spelling/spelling-stage-4.lua +++ b/Master/texmf-dist/scripts/spelling/spelling-stage-4.lua @@ -19,7 +19,7 @@ -- -- @author Stephan Hennig -- @copyright 2012, 2013 Stephan Hennig --- @release version 0.4 +-- @release version 0.41 -- -- @trick Prevent LuaDoc from looking past here for module description. --[[ Trick LuaDoc into entering 'module' mode without using that command. diff --git a/Master/texmf-dist/tex/luatex/spelling/spelling.sty b/Master/texmf-dist/tex/luatex/spelling/spelling.sty index 7b06b097c23..8e780b432fe 100644 --- a/Master/texmf-dist/tex/luatex/spelling/spelling.sty +++ b/Master/texmf-dist/tex/luatex/spelling/spelling.sty @@ -11,7 +11,7 @@ %% See file README for more information. %% \ProvidesPackage{spelling} - [2013/05/23 v0.4 Support for spell-checking of LuaTeX documents (SH)] + [2013/05/25 v0.41 Support for spell-checking of LuaTeX documents (SH)] \NeedsTeXFormat{LaTeX2e}[1999/12/01] % Test for the LuaTeX engine. \RequirePackage{ifluatex} @@ -22,6 +22,8 @@ \fi % Lua module version management. \RequirePackage{luatexbase-modutils} +% LuaTeX call-back management. +\RequirePackage{luatexbase-mcb} % User-defined whatsit node ID allocation. \RequirePackage{luatexbase-attr} % Load main Lua file. |