From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79953 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: Count the words per line Date: Mon, 17 Dec 2012 19:30:57 +0100 Message-ID: <20121217183057.GA9642@phlegethon.router_intern> References: <50CB1441.8060609@mmnetz.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0295684139==" X-Trace: ger.gmane.org 1355769067 9429 80.91.229.3 (17 Dec 2012 18:31:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Dec 2012 18:31:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 17 19:31:22 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TkfTF-0003Ug-VL for gctc-ntg-context-518@m.gmane.org; Mon, 17 Dec 2012 19:31:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E649A1025A; Mon, 17 Dec 2012 19:31:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3ncqHB0lvu4w; Mon, 17 Dec 2012 19:31:04 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 75F3F10223; Mon, 17 Dec 2012 19:31:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DD5AB10223 for ; Mon, 17 Dec 2012 19:31:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dQ09Nn6+C31S for ; Mon, 17 Dec 2012 19:31:01 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id A4C8F101F8 for ; Mon, 17 Dec 2012 19:31:01 +0100 (CET) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qBHIV08B021446 for ; Mon, 17 Dec 2012 19:31:00 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id qBHIUxXI027841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 17 Dec 2012 19:31:00 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id qBHIUxtu011279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 17 Dec 2012 19:30:59 +0100 Original-Received: from localhost (p50846C0A.dip.t-dialin.net [80.132.108.10]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id qBHIUwdR002490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 17 Dec 2012 19:30:59 +0100 Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: <50CB1441.8060609@mmnetz.de> X-Operating-System: Linux phlegethon 3.6.8-1-ARCH X-License: "CC-BY-SA 3.0" User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0035 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NIAGv00g - 373a81c7ae90 - 20121217 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79953 Archived-At: --===============0295684139== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline --wac7ysb48OaltWcw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Huseyin, =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 > I am setting with grid-set, and I am wondering, if there is a > possibility to count the number of words in the lines (not for each > single line, but in average over all lines). take a look at this: t-wordsperline.mkvi http://pastebin.com/ZjEY1w1p wordsperline.lua http://pastebin.com/YW2R97Cm Usage: \usemodule[wordsperline] \starttext \startlinestats \dorecurse{42}{% \input knuth\par \input ward\par \input tufte\par \input zapf\par } \stoplinestats \stoptext (Works best with the --silent flag!) > That would be helpful > to get a perfectly readably book (words per row is one of these > readability-measures). That tool could ignore hyphenated words at > the end of a line, or count it with 0.5, or whatever. Hyphenated words are counted as half a word on both lines so each word amounts to exactly one. This does not account for more complex horizontal material like boxes which may contain words. Also the word model is extremely simplistic, so some kinds of punctuation and effects like letter spacing can distort the values. Thus depending on the content of your document the figures might not be accurate; ymmv. (Took a bit longer because initially I planned on placing the stats in the inner and outer margin for each line. Turns out this can=E2=80=99t be done with simple (Lua) means in Context because it would interfere with the margin mechanism. So I had to scrap the first approach and rewrote it to display stats only at the end of the document.) Regards Philipp --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --wac7ysb48OaltWcw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlDPZOAACgkQ02lYlJYWs9Ki8ACaAvSCjRhTdY3VaYb1ySWhG4Xh t6EAoIBVdUgFhFyVUKwc5pYo2SgiRr1v =BP/6 -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- --===============0295684139== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0295684139==--