From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80840 Path: news.gmane.org!not-for-mail From: Marco Patzer Newsgroups: gmane.comp.tex.context Subject: Re: Find too long sentences Date: Fri, 15 Feb 2013 17:16:56 +0100 Message-ID: <20130215161656.GK3733@homerow> References: <511E41F6.5070707@mmnetz.de> <20130215145223.GI3733@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0765594950==" X-Trace: ger.gmane.org 1360945027 19215 80.91.229.3 (15 Feb 2013 16:17:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2013 16:17:07 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 15 17:17:29 2013 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 1U6Nya-0000tv-Vs for gctc-ntg-context-518@m.gmane.org; Fri, 15 Feb 2013 17:17:29 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6A67D101F0; Fri, 15 Feb 2013 17:17:09 +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 bdp1ZEuuSI98; Fri, 15 Feb 2013 17:17:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9F0E6101E3; Fri, 15 Feb 2013 17:17:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0F38C101E3 for ; Fri, 15 Feb 2013 17:17: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 yuHSXpQXbm3P for ; Fri, 15 Feb 2013 17:17:00 +0100 (CET) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id BEEF8101E0 for ; Fri, 15 Feb 2013 17:17:00 +0100 (CET) Original-Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r1FG4PWf028825 for ; Fri, 15 Feb 2013 17:04:26 +0100 Original-Received: from c.earth.lavabit.com (c.earth.lavabit.com [192.168.111.12]) by karen.lavabit.com (Postfix) with ESMTP id 78C9011B984 for ; Fri, 15 Feb 2013 10:16:58 -0600 (CST) Original-Received: from homerow (miun111-154.dynamic.miun.se [193.10.111.154]) by lavabit.com with ESMTP id OGACCU2DPAE9 for ; Fri, 15 Feb 2013 10:16:58 -0600 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=L6J8jBAOd6OTPrwYhOGckUg5uRfPifsBM2HD9tKcI+DWEYQpSQW7Emho4vE5O513ryLUh0wsVnbOQRnrDvx1ah/rd0b0tM4xyXsBCRrrMVBsfQGvYbmVOo6DWruHS+dF0V4al4+/JKrPengpyPvTkLCNtuT9BZxfi5Ehy2XgGZg=; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; Mail-Followup-To: ntg-context@ntg.nl In-Reply-To: <20130215145223.GI3733@homerow> User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.249.41.33; country=US; region=TX; city=Dallas; postalcode=75204; latitude=32.8019; longitude=-96.7883; metrocode=623; areacode=214; http://maps.google.com/maps?q=32.8019,-96.7883&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WJ0E4qW1 - 93c4b4e5adcc - 20130215 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 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:80840 Archived-At: --===============0765594950== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R92lf0Oi2sxyK3LA" Content-Disposition: inline --R92lf0Oi2sxyK3LA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013=E2=80=9302=E2=80=9315 Marco Patzer wrote: > In vim pressing =E2=80=9Cvis=E2=80=9D (visualise inner sentence) marks th= e current > sentence, then pressing =E2=80=9Cg=E2=80=9D yields: >=20 > Selected 2 of 4 lines; 14 of 50 words; 82 of 296 bytes >=20 > That means current sentence is 82 bytes long. The rest is up to you. > Pick a language you like, vim uses its own scripting language but > also has bindings for python, perl, lua, etc. Pseudo-code: >=20 > go to begin of file > start: > get byte length of sentence > if length > max_length > % do something > fi > move on to the next sentence > goto start Here's a quick and na=C3=AFve vim function which moves the cursor to the last sentence containing more than 250 bytes when you hit F9. function! GoToLastTooLongSentence() let maxSentenceLength =3D 250 while line('.') !=3D 1 normal ( | yis let num =3D strlen(@") if num >=3D maxSentenceLength normal vis " just for demonstration, remove this break endif endwhile endfunction noremap :call GoToLastTooLongSentence() Marco --R92lf0Oi2sxyK3LA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJRHl93AAoJEPGqVaNSn0iKOnIH/3LQ2o92aIrwPwvUIul3Hqpe S9vVGcQrhBv2JLIKRij4s7WbjmrkgDGI87gGZbIO1nNybM30in1lY/WfIYKzNPjL SMQyPAAFrSQ+AfirWoFkbZBmvVJBdwyCBXNWnztqgQYD3CsCUv6NAUt8ABSN7B1P AFcbntItiZmkkEq7bRhYa1izLw1GPjJ9gTuCjDynvbN5TJhHTzVP71RxBMsB2Xc4 4iDAHZhUrzUmvY7QQTByAYponWRPgPOeR+RGrdV6JZJQ0bh+tqh+4lDGAdzitIh6 RGec2+cy5dgIac4iun+lvyuyyioqA3CHvrjPxCGL5pzh4eSVKgW8wktjiUCiLF4= =vqnl -----END PGP SIGNATURE----- --R92lf0Oi2sxyK3LA-- --===============0765594950== 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 ___________________________________________________________________________________ --===============0765594950==--