[33155] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4434 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 18 09:09:15 2015

Date: Mon, 18 May 2015 06:09:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 18 May 2015     Volume: 11 Number: 4434

Today's topics:
        Artificial intelligence Speech() module being implement mentificium@gmail.com
    Re: wordx....not_wordx...wordy   pattern matching. sharma__r@hotmail.com
    Re: wordx....not_wordx...wordy   pattern matching. deangwilliam30@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 17 May 2015 07:16:17 -0700 (PDT)
From: mentificium@gmail.com
Subject: Artificial intelligence Speech() module being implemented in Perl
Message-Id: <7b6ee22e-46c9-42ea-bddc-521c1fc46f4b@googlegroups.com>

http://ai.neocities.org/AiSteps.html 

is the stages of creation of Strong AI 
in any given programming language and 
in any desired natural human language. 

Previous AI Minds were coded in Forth 
and in JavaScript for Microsoft Internet 
Explorer:

http://www.nlg-wiki.org/systems/Mind.Forth in English; 

http://www.nlg-wiki.org/systems/Wotan in German; 

http://www.nlg-wiki.org/systems/Mind in English; 

http://www.nlg-wiki.org/systems/Dushka in Russian. 

http://ai.neocities.org/perlmind.txt is the AI Perlmind 
being coded step-by-step and now at the Speech() module. 

Currently all these AI Minds treat keyboard characters 
as if they were the linguistic phonemes of acoustic 
speech. Further evolution of the free, open-source 
artificial intelligence will require a major 
transition from keyboard "pretend" speech 
into actual speech recognition and speech production. 
Since Perl supports Unicode for virtually all 
character sets in natural human language, the Perl 
AI Steps are open to creating polyglot AI Minds.

The emerging Perlmind is a third-generation AI 
in which the Speech() output module is no longer
the sole avenue of quasi-phonemic output. 
Since the AI Minds in German and in Russian 
require inflection of verbal output on the fly, 

http://code.google.com/p/mindforth/wiki/VerbGen 

is a new mind-module in the cognitive architecture 
and is for the diversion of phonemic output away 
from the legacy Speech() module, which however 
continues to output uininflected words such as 
conjunctions and prepositions. 

Stay tuned for further details as we implement 
the superintelligent Strong AI Singularity 
in Perl.

ATM/Mentifrex
-- 
http://www.reddit.com/r/perl 
http://dl.acm.org/citation.cfm?doid=307824.307853 
http://www.cpan.org/authors/id/M/ME/MENTIFEX/mind.txt 
http://aihub.net/artificial-intelligence-lab-projects 


------------------------------

Date: Sun, 17 May 2015 05:04:22 -0700 (PDT)
From: sharma__r@hotmail.com
Subject: Re: wordx....not_wordx...wordy   pattern matching.
Message-Id: <64a5e754-1ca8-41c6-ae0b-436ee30a6125@googlegroups.com>

On Saturday, 16 May 2015 23:30:15 UTC+5:30, deangwi...@gmail.com  wrote
> 
> ===========================================================
> procedure blob0 a stray proc line
> 
> procedure blob1 closest proc preceding first begin
> var
> somevar...
> begin
> <insert trace line here
> 
> begin
> end;
> 
> end;
> 
> 
> function blob2  closest function line preceding first begin
> var
> some var
> begin
> <insert trace line here
> begin
> end;
> 
> end;
> ===========================================================
> 
> My sample data is above as is my recipe. 
> If someone not given to personal insults could respond with a possible solution
> I'd be very grateful.

perl -0777pe '
s/^(?:procedure|function)\s+(\S+)\s+(?:(?!\n(?:procedure|function)\s).)*?\nbegin/"$&\ngTrace.log(\"$1\")"/mesg
' yourfile

HTH

Notes: 
 a) Invoke perl in the slurp mode. (-0777)
 b) Turn on auto-print. (-p)
 c) The regex looks at fresh lines that start with either of the keywords,
    "procedure" or "function". Then in the process of grabbing the nearest
    "begin" on a fresh line, it must not encounter the keywords "procedure"
    or "function" after a newline, in order for the regex to succeed & trigger
    the substitution. These actions are repeated until the end of file(=string).
    During scanning, the func/proc name is grabbed & stored in $1. The s/// 
    operator is invoked with the options "m,e,s,g".


------------------------------

Date: Sun, 17 May 2015 11:13:17 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy   pattern matching.
Message-Id: <6dc6ac41-1d6d-4fb0-a544-e134a37a34e1@googlegroups.com>

shar...@hotmail.com 	
1:04 PM (6 hours ago)
On Saturday, 16 May 2015 23:30:15 UTC+5:30, deangwi...@gmail.com  wrote
>
> ===========================================================
> procedure blob0 a stray proc line
>
> procedure blob1 closest proc preceding first begin
> var
> somevar...
> begin
> <insert trace line here
>
> begin
> end;
>
> end;
>
>
> function blob2  closest function line preceding first begin
> var
> some var
> begin
> <insert trace line here
> begin
> end;
>
> end;
> ===========================================================
>
> My sample data is above as is my recipe.
> If someone not given to personal insults could respond with a possible solution
> I'd be very grateful.

perl -0777pe '
s/^(?:procedure|function)\s+(\S+)\s+(?:(?!\n(?:procedure|function)\s).)*?\nbegin/"$&\ngTrace.log(\"$1\")"/mesg
' yourfile

HTH

Notes:
 a) Invoke perl in the slurp mode. (-0777)
 b) Turn on auto-print. (-p)
 c) The regex looks at fresh lines that start with either of the keywords,
    "procedure" or "function". Then in the process of grabbing the nearest
    "begin" on a fresh line, it must not encounter the keywords "procedure"
    or "function" after a newline, in order for the regex to succeed & trigger
    the substitution. These actions are repeated until the end of file(=string).
    During scanning, the func/proc name is grabbed & stored in $1. The s///
    operator is invoked with the options "m,e,s,g".

Shar 
Thank you very much both for your solution and detailed explanation which, at the moment, helps a lot.
Much appreciated.
Dean


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 4434
***************************************


home help back first fref pref prev next nref lref last post