Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- Date: Wed, 18 Jan 2006 21:16:46 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- References: <43CDFC16.7030808@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b24 (dandelion, linux)
>>>>> "David" == David Riggs <dariggs@example.com> writes: David> The ugly part is that I have to go edit the perl script David> file each time, and do a little emacs deal to insert the $w David> between each kanji. Still, it works! Perl probably has a split function; make the kanji string a varaible (see below for why), and split it on "" which will give you an array of characters. Then do a join with "\$w". (defun mung-run-perl (kanji) (interactive "sTarget: ") (search-forward "# comment on line before kanji_string" (forward-line 1) (kill-line 1) ;; remove the existing "$kanji_string =" line (insert " $kanji_string = " kanji ";") ; does perl need a terminating ;? whatever (save-buffer) (shell-command (buffer-file-name)) ) Change to the buffer with the perl code in it, and M-x mung-run-perl. Season to taste. David> Steven, are you serious, can you do something like this David> with egrep and elisp? That would be great. I would love to David> hear more. The perl will do as well as the egrep, and you've already got that working. I'm not sure, maybe egrep would be faster. Elisp itself is much too slow for this job, and Emacsen like to read entire files into the buffer; that's why I suggested a simple grep into a buffer and post-processing with elisp for presentation. But 60 seconds is a long time. You really should find some way to get this indexed. Is there any restriction on the strings, or are they basically arbitrary sequences of CJK ideographs? -- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Follow-Ups:
- References:
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] CJK Latex: embed Type1 fonts in my pdf file
- Next by Date: Re: [tlug] Editing Soud Files (WAV & MP3)
- Previous by thread: [tlug] searching for kanji strings, ignore punctuation and end of lines: Perl Solution and comments
- Next by thread: Re: [tlug] searching for kanji strings, ignore punctuation and endof lines: Perl Solution and comments
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links