AI-MicroStructure

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

This software is copyright (c) 2014 by hagen geissler santex@cpan.org.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

Terms of the Perl programming language system itself

a) the GNU General Public License as published by the Free
   Software Foundation; either version 1, or (at your option) any
   later version, or
b) the "Artistic License"

--- The GNU General Public License, Version 1, February 1989 ---

This software is Copyright (c) 2014 by hagen geissler santex@cpan.org.

This is free software, licensed under:

  The GNU General Public License, Version 1, February 1989

                    GNU GENERAL PUBLIC LICENSE
                     Version 1, February 1989

 Copyright (C) 1989 Free Software Foundation, Inc.
 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The license agreements of most software companies try to keep users
at the mercy of those companies.  By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must tell them their rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  The precise terms and conditions for copying, distribution and
modification follow.

                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License.  The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications.  Each
licensee is addressed as "you".

  1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program.  You may charge a fee for the physical act of
transferring a copy.

  2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:

    a) cause the modified files to carry prominent notices stating that
    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either
    with or without modifications, to be licensed at no charge to all
    third parties under the terms of this General Public License (except
    that you may choose to grant warranty protection to some or all
    third parties, at your option).

    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.

  3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:

    a) accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    b) accompany it with a written offer, valid for at least three
    years, to give any third party free (except for a nominal charge
    for the cost of distribution) a complete machine-readable copy of the
    corresponding source code, to be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    c) accompany it with the information you received as to where the
    corresponding source code may be obtained.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form alone.)

Source code for a work means the preferred form of the work for making
modifications to it.  For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.

  4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License.  However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.

  5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions.  You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.

  7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.

  8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

                            NO WARRANTY

  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19xx name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  program `Gnomovision' (a program to direct compilers to make passes
  at assemblers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

That's all there is to it!


--- The Artistic License 1.0 ---

This software is Copyright (c) 2014 by hagen geissler santex@cpan.org.

This is free software, licensed under:

  The Artistic License 1.0

The Artistic License

Preamble

The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of
the package the right to use and distribute the Package in a more-or-less
customary fashion, plus the right to make reasonable modifications.

Definitions:

  - "Package" refers to the collection of files distributed by the Copyright
    Holder, and derivatives of that collection of files created through
    textual modification. 
  - "Standard Version" refers to such a Package if it has not been modified,
    or has been modified in accordance with the wishes of the Copyright
    Holder. 
  - "Copyright Holder" is whoever is named in the copyright or copyrights for
    the package. 
  - "You" is you, if you're thinking about copying or distributing this Package.
  - "Reasonable copying fee" is whatever you can justify on the basis of media
    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

  a) place your modifications in the Public Domain or otherwise make them
     Freely Available, such as by posting said modifications to Usenet or an
     equivalent medium, or placing the modifications on a major archive site
     such as ftp.uu.net, or by allowing the Copyright Holder to include your
     modifications in the Standard Version of the Package.

  b) use the modified Package only within your corporation or organization.

  c) rename any non-standard executables so the names do not conflict with
     standard executables, which must also be provided, and provide a separate
     manual page for each non-standard executable that clearly documents how it
     differs from the Standard Version.

  d) make other distribution arrangements with the Copyright Holder.

4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:

  a) distribute a Standard Version of the executables and library files,
     together with instructions (in the manual page or equivalent) on where to
     get the Standard Version.

  b) accompany the distribution with the machine-readable source of the Package
     with your modifications.

  c) accompany any non-standard executables with their corresponding Standard
     Version executables, giving the non-standard executables non-standard
     names, and clearly documenting the differences in manual pages (or
     equivalent), together with instructions on where to get the Standard
     Version.

  d) make other distribution arrangements with the Copyright Holder.

5. You may charge a reasonable copying fee for any distribution of this
Package.  You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this
Package in aggregate with other (possibly commercial) programs as part of a
larger (possibly commercial) software distribution provided that you do not
advertise this Package as a product of your own.

6. The scripts and library files supplied as input to or produced as output
from the programs of this Package do not automatically fall under the copyright
of this Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.

7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.

8. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.

9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The End

MANIFEST  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.041.
LICENSE
MANIFEST
META.yml
Makefile.PL
README.md
bin/chrono
bin/from-folder.pl
bin/getcat
bin/getcat.pl
bin/getfiles.sh
bin/getnice
bin/leo
bin/linksearch
bin/linksearch~
bin/localfiles
bin/micro
bin/micro-dict
bin/micro-dict~
bin/micro-leo
bin/micro-relation
bin/micro-relation-test
bin/micro-rename
bin/micro-sense
bin/micro-soundex
bin/micro-steemer
bin/micro-wiki
bin/micro-wnet
bin/micrownet
bin/national
bin/newssearch
bin/park.pm
bin/pdflinks
bin/remote.pl
dist.ini
lib/AI/MicroStructure.pm
lib/AI/MicroStructure/Alias.pm
lib/AI/MicroStructure/List.pm
lib/AI/MicroStructure/Locale.pm
lib/AI/MicroStructure/MultiList.pm
lib/AI/MicroStructure/RemoteList.pm
lib/AI/MicroStructure/Util.pm
lib/AI/MicroStructure/WordBlacklist.pm
lib/AI/MicroStructure/any.pm
lib/AI/MicroStructure/foo.pm
lib/AI/MicroStructure/germany.pm
lib/icro.pm
t/canned/2013-04-04_.cache
t/canned/2013-09-16_.cache
t/canned/2013-12-29_.cache
t/canned/2013-12-30_.cache
t/canned/2014-01-11_.cache
t/canned/2014-09-27_.cache
t/canned/docs/antimatter.pm
t/canned/docs/atom.pm
t/canned/docs/atoms.pm
t/canned/docs/exponent.pm
t/canned/docs/exponential.pm
t/canned/docs/log.pm
t/canned/docs/logic.pm
t/canned/docs/mathematics.pm
t/canned/docs/matter.pm
t/canned/docs/number.pm
t/canned/docs/numbers.pm
t/canned/docs/planet.pm
t/canned/docs/planets.pm
t/canned/docs/quad.pm
t/canned/docs/quadratic.pm
t/canned/docs/tan.pm
t/canned/docs/wolfram/AlgebraicProperties.html
t/canned/docs/wolfram/AutomorphicForms.html
t/canned/docs/wolfram/BayesianAnalysis.html
t/canned/docs/wolfram/Biography.html
t/canned/docs/wolfram/Business.html
t/canned/docs/wolfram/ComplexSystems.html
t/canned/docs/wolfram/HarmonicAnalysis.html
t/canned/docs/wolfram/InverseProblems.html
t/canned/docs/wolfram/Low-DimensionalTopology.html
t/canned/docs/wolfram/NoncommutativeGeometry.html
t/canned/docs/wolfram/NumberGuessing.html
t/canned/docs/wolfram/Numbers.html
t/canned/docs/wolfram/Runs.html
t/canned/docs/wolfram/ScalarAlgebra.html
t/canned/docs/wolfram/Springer.Scheper.&.Fiechter.(2000).Advances.in.biochemical.engineering.biotechnology.History.of.modern.biotechnology.1.v.69.Springer.pdf
t/canned/docs/wolfram/Springer.statistical_methods_for_biostatistics_hardle_2007_springer.pdf
t/canned/docs/wolfram/TheoremProving.html
t/canned/docs/wolfram/mathworld_index.html
t/canned/sample.tdm
t/micro-test.pl
t/t/001.t
t/t/0010.t
t/t/0011.t
t/t/0012.t
t/t/0013.t
t/t/002.t
t/t/003.t
t/t/004.t
t/t/005.t
t/t/006.t
t/t/007.t
t/t/008.t
t/t/009.t
t/t/basedep.dodo.t
t/t/basedep.santex.t
t/t/load-prerequest.t
t/t/micro-test

META.yml  view on Meta::CPAN

---
abstract: 'AI::MicroStructure   Creates Concepts for words'
author:
  - 'santex <santex@cpan.org>'
build_requires: {}
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.041, CPAN::Meta::Converter version 2.142690'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: AI-MicroStructure
no_index:
  directory:
    - misc
requires:
  AI::Categorizer: '0'
  AI::Categorizer::Document: '0'
  AI::Categorizer::KnowledgeSet: '0'
  AI::Categorizer::Learner::NaiveBayes: '0'
  Algorithm::BaumWelch: '0'
  AnyDBM_File: '0'
  AnyEvent::Subprocess::Easy: '0'
  Cache::Memcached::Fast: '0'
  Carp: '0'
  Class::Container: '0'
  Config::Auto: '0'
  Cwd: '0'
  Data::Dumper: '0'
  Data::Printer: '0'
  Digest::MD5: '0'
  Digest::SHA1: '0'
  Exporter: '0'
  Fcntl: '0'
  File::Basename: '0'
  File::Glob: '0'
  File::HomeDir: '0'
  File::Spec: '0'
  Getopt::Long: '0'
  HTML::SimpleLinkExtor: '0'
  HTML::Strip: '0'
  HTTP::Request::Common: '0'
  IO::Async::Loop: '0'
  IO::File: '0'
  JSON: '0'
  JSON::XS: '0'
  LWP::UserAgent: '0'
  Lingua::StopWords: '0'
  List::Util: '0'
  Mojolicious: '0'
  Net::Async::WebSocket::Server: '0'
  Parallel::Iterator: '0'
  Params::Validate: '0'
  Search::ContextGraph: '0'
  Statistics::Basic: '0'
  Statistics::Contingency: '0'
  Statistics::Descriptive: '0'
  Statistics::Distributions::Ancova: '0'
  Statistics::MVA::BayesianDiscrimination: '0'
  Statistics::MVA::HotellingTwoSample: '0'
  Storable: '0'
  Storable::CouchDB: '0'
  Sysadm::Install: '0'
  perl: v5.14.1
resources:
  homepage: http://active-memory.de:2323
version: '0.20'

Makefile.PL  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.041.
use strict;
use warnings;

use 5.014001;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "AI::MicroStructure   Creates Concepts for words",
  "AUTHOR" => "santex <santex\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "AI-MicroStructure",
  "EXE_FILES" => [
    "bin/chrono",
    "bin/from-folder.pl",
    "bin/getcat",
    "bin/getcat.pl",
    "bin/getfiles.sh",
    "bin/getnice",
    "bin/leo",
    "bin/linksearch",
    "bin/linksearch~",
    "bin/localfiles",
    "bin/micro",
    "bin/micro-dict",
    "bin/micro-dict~",
    "bin/micro-leo",
    "bin/micro-relation",
    "bin/micro-relation-test",
    "bin/micro-rename",
    "bin/micro-sense",
    "bin/micro-soundex",
    "bin/micro-steemer",
    "bin/micro-wiki",
    "bin/micro-wnet",
    "bin/micrownet",
    "bin/national",
    "bin/newssearch",
    "bin/park.pm",
    "bin/pdflinks",
    "bin/remote.pl"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.014001",
  "NAME" => "AI::MicroStructure",
  "PREREQ_PM" => {
    "AI::Categorizer" => 0,
    "AI::Categorizer::Document" => 0,
    "AI::Categorizer::KnowledgeSet" => 0,
    "AI::Categorizer::Learner::NaiveBayes" => 0,
    "Algorithm::BaumWelch" => 0,
    "AnyDBM_File" => 0,
    "AnyEvent::Subprocess::Easy" => 0,
    "Cache::Memcached::Fast" => 0,
    "Carp" => 0,
    "Class::Container" => 0,
    "Config::Auto" => 0,
    "Cwd" => 0,
    "Data::Dumper" => 0,
    "Data::Printer" => 0,
    "Digest::MD5" => 0,
    "Digest::SHA1" => 0,
    "Exporter" => 0,
    "Fcntl" => 0,
    "File::Basename" => 0,
    "File::Glob" => 0,
    "File::HomeDir" => 0,
    "File::Spec" => 0,
    "Getopt::Long" => 0,
    "HTML::SimpleLinkExtor" => 0,
    "HTML::Strip" => 0,
    "HTTP::Request::Common" => 0,
    "IO::Async::Loop" => 0,
    "IO::File" => 0,
    "JSON" => 0,
    "JSON::XS" => 0,
    "LWP::UserAgent" => 0,
    "Lingua::StopWords" => 0,
    "List::Util" => 0,
    "Mojolicious" => 0,
    "Net::Async::WebSocket::Server" => 0,
    "Parallel::Iterator" => 0,
    "Params::Validate" => 0,
    "Search::ContextGraph" => 0,
    "Statistics::Basic" => 0,
    "Statistics::Contingency" => 0,
    "Statistics::Descriptive" => 0,
    "Statistics::Distributions::Ancova" => 0,
    "Statistics::MVA::BayesianDiscrimination" => 0,
    "Statistics::MVA::HotellingTwoSample" => 0,
    "Storable" => 0,
    "Storable::CouchDB" => 0,
    "Sysadm::Install" => 0
  },
  "VERSION" => "0.20",
  "test" => {
    "TESTS" => "t/t/*.t"
  }
);


my %FallbackPrereqs = (
  "AI::Categorizer" => 0,
  "AI::Categorizer::Document" => 0,
  "AI::Categorizer::KnowledgeSet" => 0,
  "AI::Categorizer::Learner::NaiveBayes" => 0,
  "Algorithm::BaumWelch" => 0,
  "AnyDBM_File" => 0,
  "AnyEvent::Subprocess::Easy" => 0,
  "Cache::Memcached::Fast" => 0,
  "Carp" => 0,
  "Class::Container" => 0,
  "Config::Auto" => 0,
  "Cwd" => 0,
  "Data::Dumper" => 0,
  "Data::Printer" => 0,
  "Digest::MD5" => 0,
  "Digest::SHA1" => 0,
  "Exporter" => 0,
  "Fcntl" => 0,
  "File::Basename" => 0,
  "File::Glob" => 0,
  "File::HomeDir" => 0,
  "File::Spec" => 0,
  "Getopt::Long" => 0,
  "HTML::SimpleLinkExtor" => 0,
  "HTML::Strip" => 0,
  "HTTP::Request::Common" => 0,
  "IO::Async::Loop" => 0,
  "IO::File" => 0,
  "JSON" => 0,
  "JSON::XS" => 0,
  "LWP::UserAgent" => 0,
  "Lingua::StopWords" => 0,
  "List::Util" => 0,
  "Mojolicious" => 0,
  "Net::Async::WebSocket::Server" => 0,
  "Parallel::Iterator" => 0,
  "Params::Validate" => 0,
  "Search::ContextGraph" => 0,
  "Statistics::Basic" => 0,
  "Statistics::Contingency" => 0,
  "Statistics::Descriptive" => 0,
  "Statistics::Distributions::Ancova" => 0,
  "Statistics::MVA::BayesianDiscrimination" => 0,
  "Statistics::MVA::HotellingTwoSample" => 0,
  "Storable" => 0,
  "Storable::CouchDB" => 0,
  "Sysadm::Install" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);

README.md  view on Meta::CPAN

AI-MicroStructure
=================

A concept is a mental representation for a word or any form of inputs!

Concepts allows us to draw appropriate inferences about the type of entities we encounter in our everyday lives!

The use of concepts is necessary to cognitive processes such as categorization, memory, decision making, learning and inference.

AI-MicroStructure is a package to build concepts for words.

Anybody whisching to do categorization, memory, decision making, learning and inference.

requires as much concepts for a specific (word,idea,sensor input) as possible to base any further knowledge or decission on

to be able to fly you require only to types

```
micro new extraterrestrial_life


               .--'"""""--.>_
            .-'  o\\b.\o._o.`-.
         .-'.- )  \d888888888888b.
        /.'   b  Y8888888888888888b.
      .-'. 8888888888888888888888888b
     / o888 Y Y8888888888888888888888b
     / d888P/ /| Y"Y8888888888888888888b
   J d8888/| Y .o._. "Y8888888888888Y" \
   |d Y888b|obd88888bo. """Y88888Y' .od8
   Fdd 8888888888888888888bo._'|| d88888|
   Fd d 88\ Y8888Y "Y888888888b, d888888P
   d-b 8888b Y88P'     """""Y888b8888P"|
  J  8\88888888P    `m.        """""   |
  || `8888888P'       "Ymm._          _J
  |\\  Y8888P  '     .mmm.YM)     .mMF"'
  | \\  Y888J     ' < (@)>.- `   /MFm. |
  J   \  `YY           ""'   ::  MM @)>F
   L  /)  88                  :  |  ""\|
   | ( (   Yb .            '  .  |     L
   \   bo  8b    .            .  J     |        The word extraterrestrial
    \      "' .      .    .    .  L   F         has 1 concept's
     o._.:.    .        .  \mm,__J/  /          we need to find out the which one
     Y8::'|.            /     `Y8P  J           to use for our new,
     `|'  J:   . .     '   .  .   | F           micro-structure,
      |    L          ' .    _:    |            
      |    `:        . .:oood8bdb. |            (1): a form of life assumed to exist outside the earth or its atmosphere extraterrestrial
      F     `:.          "-._   `" F            
     /       `::.           """'  /             
    /         `::.          ""   /              
_.-d(          `:::.            F               
-888b.          `::::.     .  J                 
Y888888b.          `::::::::::'                 
Y88888888bo.        `::::::d                    
`"Y8888888888boo.._   `"dd88b.                  





"""""""""""""""""""""""""""""""""""""""""""""""


  Type: the number you choose 1..1
  1
extraterrestrialbeing
extraterrestrial
alien
hypothetical_creature
imaginary_being
imaginary_creature
imagination
imaginativeness
vision
creativity
creativeness
creative_thinking
ability
power
cognition
knowledge
noesis
psychological_feature
abstraction
abstract_entity
entity
extraterrestrialbeing
extraterrestrial
alien
hypothetical_creature

``` 




  ☞ [sample](http://quantup.com)

  ☞ [PDF info](https://github.com/santex/active-memory/raw/master/start-here.pdf)



#### Dependencies

* cpan
* couchdb
* wordnet
* tesseract
* xpdf-utils (poppler-utils)

#### Copyright

  Copyright (C) 2009-2012 Hagen "santex" Geissler


# Usage sample use 

```


#try something like this

  $ micro new ufo;      # creates a structure called ufo

  $ micro drop ufo;     # deletes the structure called ufo

  $ micro structures;   # shows all structure's you currently have

  #after creation of a structure you can access it in lots of ways



  $ micro;             # one word of a random structure

  $ micro ufo;         # one word of the ufo structure

  $ micro ufo all;     # all words of the ufo structure

  $ micro ufo 5;       # 5 random words of the ufo structure

  $ micro any 10;      # 10 random words of any structure you have created


  $ micro --init        # initializes active memory

  $ micro --export      # export relations from couchdb into git repo and tag data


  # oneliners i like to use

  $  for i in `micro structures`; do echo $i; done;       # echos all the structures

  $  for i in `micro ufo all`;   do echo $i; done;       # echos all words in ufo

  $  for i in `micro structures`; do micro all $i; done;  # echos all stuctures all words

  $  for i in `micro ufo all`;   do micro new $i; done;  # new structure for all words in ufo

  $  for i in `micro ufo all`;   do micro-wiki $i; done; # push all words against the wiki plugin dont forget setting user & password in /usr/local/bin/micro-wiki

  ###################################################################################
  # try to follow the logic combine
  # your-word=micro new ? ->concept->concepts->relations->node


  $ micro new biology
  $ micro new biological_process

  $ for i in `micro structures`; do
  $ for y in `micro all $i `; do
  $ echo "$i=$y";
  $ micro new $y;
  $ done
  $ done

  #!!!!!###Hard cpu to expect ### make sure couch is on   ######  or disable the store methode in micro-wiki and print $doc or consume otherweise
  # test as single before you loope 
  
  $ micro-wiki ufo
  
  # proceed

  $ for i in `micro structures`; do
  $ for y in `micro all $i `; do
  $ echo "$i=$y";
  $ micro-wiki $y;
  $ done
  $ done




```
# compounding knowledge


```
  
               .--'"""""--.>_
            .-'  o\\b.\o._o.`-.
         .-'.- )  \d888888888888b.
        /.'   b  Y8888888888888888b.
      .-'. 8888888888888888888888888b
     / o888 Y Y8888888888888888888888b
     / d888P/ /| Y"Y8888888888888888888b
   J d8888/| Y .o._. "Y8888888888888Y" \
   |d Y888b|obd88888bo. """Y88888Y' .od8
   Fdd 8888888888888888888bo._'|| d88888|
   Fd d 88\ Y8888Y "Y888888888b, d888888P
   d-b 8888b Y88P'     """""Y888b8888P"|
  J  8\88888888P    `m.        """""   |
  || `8888888P'       "Ymm._          _J
  |\\  Y8888P  '     .mmm.YM)     .mMF"'
  | \\  Y888J     ' < (@)>.- `   /MFm. |
  J   \  `YY           ""'   ::  MM @)>F
   L  /)  88                  :  |  ""\|
   | ( (   Yb .            '  .  |     L
   \   bo  8b    .            .  J     |        
    \      "' .      .    .    .  L   F         
     o._.:.    .        .  \mm,__J/  /          
     Y8::'|.            /     `Y8P  J           
     `|'  J:   . .     '   .  .   | F           
      |    L          ' .    _:    |            
      |    `:        . .:oood8bdb. |            
      F     `:.          "-._   `" F            
     /       `::.           """'  /             
    /         `::.          ""   /              
_.-d(          `:::.            F               
-888b.          `::::.     .  J                 
Y888888b.          `::::::::::'                 
Y88888888bo.        `::::::d                    
`"Y8888888888boo.._   `"dd88b.                  
```





one way more easy would be to steam a large amount knowledge over complete discipline structure and categorize it on the smallest node .
then we sort density and lower the scope to compute compounding
by the factor the density map is large.

as more detailed the steaming becomes minimum for compounding (math formulas , corresponding arithmetic)
the Categorizer has to adapt but we will have him well trained with the initial steam.
all left to compounding is the hypothesis and experiment compatible with harvested formulas and arithmetic
on a very small scope or adjustable by density.

:)

bin/chrono  view on Meta::CPAN

#!/usr/bin/env perl
use warnings;
use Data::Printer;
use JSON;
use Try::Tiny;
use File::Copy;
use Data::Dumper;

my $file = shift;
my $encoder = JSON->new->allow_blessed->pretty(0);

sub soundex
{

    #my $dir = shift;
    my $file = shift;
    push @_,$file;
    local( @res ) = map {$_=$_}@_; local($i, $t,$_);
    for ( @res ) { tr/a-zA-Z//cd; tr/a-zA-Z/A-ZA-Z/s;
        ($i,$t) = /(.)(.*)/;
       $t =~ tr/BFPVCGJKQSXZDTLMNRAEHIOUWY/111122222222334556/sd;
       $_ = substr(($i||'Z').$t.'000', 0, 4 );

    }
#    move($file,$targetdir);
    return {$file=>[grep(!/000/,@res)]};
}



open my $info, $file or die "Could not open $file: $!";

my @line = map{try{$encoder->decode($_)};}<$info>;
close $info;


my $i = $#line;
print $i;
my $ret = {};
foreach(@line){
my $duration  = $_->{_end} -$_->{_start};

my @test = split /\/|\.| |-/,$_->{name};


   $ret->{$_->{application}}->{$_->{name}}  =     [$ret->{$_->{application}}->{$_->{name}}  ? 
      $ret->{$_->{application}}->{$_->{name}} + 1 : 1 ,$duration];

}

p $ret;
1;
__DATA__
application   "other",
category      "other",
class         ""konsole", "Konsole"",
command       "{ "/usr/bin/konsole" }",
_end          1415148737,
id            "0x804e33",
name          ""~/repos/app-chronos : perl"",
role          ""MainWindow#3"",
_start        1415148732

bin/from-folder.pl  view on Meta::CPAN

#!/usr/bin/perl -w
use strict;

use File::Find;
use Storable qw(lock_store lock_retrieve);
use Getopt::Long;
use Digest::MD5 qw(md5_hex);
use Data::Dumper;
use Data::Printer;
use Env qw(PWD);
my ($TOP,$storage) ;
       $TOP = $ARGV[0] unless(!@ARGV);
       $storage = $ARGV[1] unless(!@ARGV);
        $storage = "/tmp" unless($storage);
our $cache = {};
our $files={};
our $curSysDate = `date +"%F"`;
        $curSysDate=~ s/\n//g;

our %opts = (cache_file =>
              sprintf("%s/%s_.cache",
              $storage,$curSysDate));

GetOptions (\%opts, "cache_file=s");



sub translate
{
  return unless -f;
  (my $rel_name = $File::Find::name) =~ s{.*/}{}xs;
   my $name = md5_hex($rel_name);
    my $go = 0;

     foreach(@ARGV){
    my $t = $_;

    if( ! -d $t &&  $rel_name !~ m/($t)/i){
        $go ++;
        print $rel_name."\n";
       }
    }
        

        if (/\.(html|htm)$/) {
          $files->{html}->{$name}=$rel_name;
        }elsif (/\.txt$/) {
          $files->{latex}->{$name}=$rel_name;
        }elsif (/\.json$/) {
          $files->{text}->{$name}=$rel_name;
        }
        
  }


find(\&translate, "$TOP");


p @{[keys %$files,reverse @ARGV,$storage]};

__DATA__
our $c = AI::MicroStructure::Context->new(@ARGV);
    $c->retrieveIndex($PWD."/t/docs"); #"/home/santex/data-hub/data-hub" structures=0 text=1 json=1



   my $style = {};
      $style->{explicit}  = 1;
ok($c->simpleMixedSearch($style,$_)) && ok($c->play($style,$_))   for
 qw(atom antimatter planet);



ok(print Dumper $c->intersect($style,$_)) for
 qw(atom antimatter planet);

ok(print Dumper $c->similar($style,$_)) for
 qw(atom antimatter planet);

#p @out;

1;

package main;

$|++;
use strict;

use Fi  le::Find;
use Data::Dumper;
use Storable qw(lock_store lock_retrieve);
use Getopt::Long;
our $curSysDate = `date +"%F"`;
    $curSysDate=~ s/\n//g;

our %opts = (cache_file =>
              sprintf("/tmp/%s.cache",
              $curSysDate));

GetOptions (\%opts, "cache_file=s");

our $cache = {};
our @target = split("\/",$opts{cache_file});
my $set = AI::MicroStructure::ObjectSet->new();

eval {
    local $^W = 0;  # because otherwhise doesn't pass errors
#`rm $opts{cache_file}`;
    $cache = lock_retrieve($opts{cache_file});

    $cache = {} unless $cache;

    warn "New cache!\n" unless defined $cache;
};


END{

  lock_store($cache,$opts{cache_file});

  print Dumper [$set->size,$set->members];


  }




find(\&translate, "$TOP/./");

sub translate {
  return unless -f;
  (my $rel_name = $File::Find::name) =~ s{.*/}{}xs;

  $set->insert(AI::MicroStructure::Object->new($rel_name));

}
#print Dumper join "-", soundex(("rock'n'roll", 'rock and roll', 'rocknroll'));

bin/getcat  view on Meta::CPAN

#!/bin/bash

IFS=$'\n'
urldecode(){
  echo -e "$(sed 's/+/ /g; s/%/\\x/g')"
}


if [ ! $MICRO_LANG ]
 then
  MICRO_LANG=en
fi
search=$1;
search=$(perl -e "print ucfirst($search)");
nogo="http:\/\/|Articles|Artikel|Wikipedia|Commons|Tracking_|Hidden_|Talk_|_talk|Use_dmy_dates|_Diskussion|Pages_containing "
function getcat(){
search=$(perl -e "print ucfirst('$1')");
q="http://$MICRO_LANG.wikipedia.org/wiki/$search";
for i in `mojo get "$q" a  attr href   | egrep "^\/wiki\/(Category|Kategorie)" | egrep -vi "("$nogo")" |   sort | sed -s "s/\/wiki\///"`; do q=$i;   echo $i | urldecode; done
}

getcat $search

#qq=$(echo "$search" | sed "s/^.*.://" | tr "_" "|");
#q=$1; cat=$(for i in `getcat "$q"`; do getcat "$i"; done); echo "$cat" | data-freq | egrep -v "http" |  sed -s "s/^.*.: //" | egrep -i "($qq)"
#q=$1; cat=$(for i in `getcat "$q"`; do qq=$(echo "$q" | sed -s "s/^.*.\://");  getcat "$i"; done);    echo "$cat" | egrep -vi "http:" | data-freq | sort -n
#echo -e "\n"

bin/getcat.pl  view on Meta::CPAN

#!/usr/bin/env perl
use File::Find::Rule;
use strict;
use warnings;
use JSON;
use Cache::Memcached::Fast;
use Try::Tiny;
use Data::Dumper;
use Digest::MD5 qw(md5 md5_hex md5_base64);

our $memd = new Cache::Memcached::Fast({
 servers => [ { address => 'localhost:11211', weight => 2.5 }],
 namespace => 'my:',
 connect_timeout => 0.2,
 io_timeout => 0.1,
 close_on_error => 1,
 compress_threshold => 100_000,
 compress_ratio => 0.9,
 max_failures => 1,
 max_size => 512 * 1024,
});



our $all = {};
our $json = JSON->new->allow_nonref;

sub mytry{
  my $cmd = shift;

try {

  #if($cmd){
  my @ret = split "\n",`$cmd`;

  return [@ret];
  #}

  };
}
sub trim
{

  my $string = shift;
  $string =  "" unless  $string;
  $string =~ s/^\s+//;
  $string =~ s/\s+$//;
  $string =~ s/\t//;
  $string =~ s/^\n//;
  $string =~ s/^\s//;
  $string =~s/\x{ef}//g;
  return $string;
}



sub check {

 my $name = shift;
 my $prog = shift;
 my $ret  = "";



 if(defined(my $ret = $memd->get(md5_hex(sprintf("%s_%s",$name,$prog))))){
    return $ret;
  }else{
    my $cmd = sprintf("%s %s",$prog,$name);
     my $ret = mytry($cmd);

     $memd->set(md5_hex(sprintf("%s_%s",$name,$prog)),$ret);
     return $ret;
  }
}

die() unless(@ARGV);

my @cat = check(shift,"getcat");

printf("%s\n",join("\n",reverse sort @{$cat[0]}));

1;

bin/getfiles.sh  view on Meta::CPAN

mojo get "https://en.wikibooks.org/w/index.php?title=Special:Search&limit=100&offset=0&ns6=0&search=crime" ".mw-search-results" | sed -s "s/\"\/\//\"http:\/\//"  > crime.files.html

bin/getnice  view on Meta::CPAN

#!/bin/bash

IFS=$'\n'

q=$1
dir=$2

if [ ! $MICRO_LANG ]
 then
  MICRO_LANG=en
fi


if [ ! $q ]
 then
  q="ufo"
fi


if [ ! $dir ]
 then
  dir="/home/santex/data-hub/stock/KnowledgeInterDisciplinary/"
fi

j=$(for i in `egrep -rli  "$q" | grep List_of_`; do
echo $i;
#echo $i | xargs -0 json-printer \-f | egrep "^\".*.$" | egrep -v ":|http|wiki|index|\/|Externallinks|References|Seealso|Listof|#|[1-9][0-9][0-9][0-9]" | tr -d "\",";
done);
echo "$j"| egrep -i "^$q|_$q"

bin/leo  view on Meta::CPAN

#!/bin/bash
if [ -z "${1}" ]; then
    search='oil'
else
    search=${1}
fi
if [ -z "${2}" ]; then
    from='en'
else
    from=${2}
fi

if [ -z "${3}" ]; then
    to='de'
else
    to=${3}
fi

onetwo='.{1,2}'
re="$1"
re="${re//[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/.}"
re="${re//ue/$onetwo}"
re="${re//ae/$onetwo}"
re="${re//oe/$onetwo}"
re="${re//ss/$onetwo}"

# have to use perl for grepping because of umlauts

q=$(lynx -dump -nolist  'http://dict.leo.org/'$from$to'?lp='$from$to'&lang='$from'&searchLoc=0&cmpType=strict&sectHdr=on&spellToler=on&search='$search'&relink=on' | perl -n -e "print if /$re/i")
#perl -MHTML::Entities  -le ' print \$q,encode_entities(\$q),\n';

#echo "$q";

perl  -MEncode -le "print decode('utf-8','$q');";

bin/linksearch  view on Meta::CPAN

mojo get "https://www.google.com/search?q=$1&aqs=chrome..69i57j69i60.211j0j1&sourceid=chrome&es_sm=122&ie=UTF-8" a attr href | egrep "^\/url" | sed -s "s/^.*.q=http/http/" | sed -s "s/\&sa=.*$//"| grep -v google

bin/linksearch~  view on Meta::CPAN

mojo get "https://www.google.com/search?q=$1&aqs=chrome..69i57j69i60.211j0j1&sourceid=chrome&es_sm=122&ie=UTF-8" a attr href | egrep "^\/url" | sed -s "s/^.*.q=http/http/" | sed -s "s/\&sa=.*$//"| grep -v google

bin/localfiles  view on Meta::CPAN

#!/usr/bin/env perl
use File::Find::Rule;
use strict;
use warnings;
use JSON;
use Cache::Memcached::Fast; 
use AI::MicroStructure;
use Data::Dumper;

my $data={};


our $memd = new Cache::Memcached::Fast({
 servers => [ { address => 'localhost:11211', weight => 2.5 }],
 namespace => 'my:',
 connect_timeout => 0.2,
 io_timeout => 0.1,
 close_on_error => 1,
 compress_threshold => 100_000,
 compress_ratio => 0.9,
 max_failures => 1,
 max_size => 512 * 1024,
});

 my @result = ();
my $rule;




foreach(@ARGV){
  
    $rule = File::Find::Rule->file->name("*$_*.*")->start("/home/santex/data-hub/stock/" ,"/home/santex/Pictures/1");
            while ( defined ( my $image = $rule->match ) ) {
                 push @result,$image;
          }
print join("\n", @result);
}






__DATA__
my $micro = AI::MicroStructure->new("any");
my $path  = $micro->{state}->{cwd};
my $picdir = sprintf("%s/%s",$ENV{"HOME"},"Pictures/1");
my $pubdir = sprintf("%s/%s",$ENV{"HOME"},"public_html");
push @INC ,-d $path  ? $path : $ENV{"HOME"};
push @INC ,-d  $picdir ? $picdir :"";
push @INC ,-d  $pubdir ? $picdir :"";

my $xx=$memd->get("localfile_".$match);
if(!$xx){
my @images = File::Find::Rule->file()
->name('*'.lc($match).'*\.(png|jpg|gif|svg)')
->in(@INC);
#my $dat = {};
#foreach(@images){
  
  #my @d = split("/",$_);
  
 # $dat->{shift @d} = $_;
#}
#@images = values $dat;#@images[0..500] unless $#images<500;
#$data->{images}=[@images];

#my $cmd = sprintf( "montage '%s' /home/santex/Pictures/montage/".$match."-all.jpg",join("' '",@{$data->{images}}));
#`$cmd`;
 
 
 my @files = File::Find::Rule->file()
->name('*'.ucfirst($match).'*\.(pdf|json|txt|xml)')
->in(@INC);
 # print  join "\n",sort{$a cmp $b}@files;
$data->{files}=[@files];

my $j = encode_json($data);
$memd->set("localfiles_".$match,$j);
print $j;
}else{
$data = decode_json( $xx);
print $xx;


}

bin/micro  view on Meta::CPAN

#!/usr/bin/perl -X

use strict;
use warnings;
use Digest::MD5 qw(md5_hex);
use AI::MicroStructure::Util;
use Getopt::Long;
use AI::MicroStructure;
use Data::Printer;
use Data::Dumper;
use JSON::XS;
use Try::Tiny;
use Cache::Memcached::Fast;
my %conf = ( );
our $keys = {};
GetOptions( \%conf, "whitespace|ws!", "version","structures", "help", "remote","new",
                    "init", "export", "import",
                    "check", "category=s", "sources" ,"drop");

our ($new, $write,$drop,$all,$verbose) =(0,0,0,0,0);
our $kkey = sprintf "%s",join("_",@ARGV);
our $argkey = md5_hex($kkey);
our $memd  = "";
sub check {

}


sub init {

  $memd = new Cache::Memcached::Fast({
     servers => [ { address => 'localhost:11211', weight => 2.5 }],
     namespace => 'my:',
     connect_timeout => 0.2,
     io_timeout => 0.1,
     close_on_error => 1,
     compress_threshold => 100_000,
     compress_ratio => 0.9,
     max_failures => 1,
     max_size => 512 * 1024,
  });

  if(!$#ARGV){
    push @ARGV,"any";
   }



if($kkey =~ /debug/){
  my $NORMAL=`tput sgr0`;
  my $REVERSE=`tput smso`;
  print "$REVERSE $_ $NORMAL " for @ARGV;
  print "\n";
}else{
}

   if(defined(my $ret = $memd->get($argkey)) && ($kkey !~ m/(any|structures)/i) &&  @ARGV){

   print "$ret\n";

   exit;
   #die($ret);
  }else{

  }


}
init();
if( grep{/\ball\b/} @ARGV ){ $all = 1; cleanArgs("all");  };


our $main = AI::MicroStructure->new();


# check if this is an active memory or initialize it
if($conf{"init"}) {
    if (-e  ".micro") {
        print STDERR "this is already an active memory!\n";
    } else {
        print `git init && touch .micro && echo .pmc > .gitignore && echo '*~' >> .gitignore && echo '*swp' >> .gitignore && echo .micro >> .gitignore && git add -f .micro .gitignore && git commit -m 'active memory born'`;
    }
    exit;
} else {
    if (!-e ".micro" && !-e $ENV{HOME}."/.micro") {
        print STDERR "this directory is not an active memory!\n";
        exit;
    }
}

my $state = AI::MicroStructure::Util::load_config(); my @CWD=$state->{cwd}; my $config=$state->{cfg};
our $structdir = "structures";
our $absstructdir = "$CWD[0]/$structdir";



if ($conf{"export"}) {
    my $cwd = $CWD[0];
    my $hash = $main->fitnes();
    my $url = sprintf("%s/%s/_all_docs", $config->{couchdb}, $config->{db});
    print `cd $cwd && mkdir -p relations && wget -O relations/any.json $url && git add relations/any.json $structdir/*.pm && git commit -m 'active memory release' && git tag $hash`; # FIXME check for errors FIXME also that we commit per structure and...

    exit;
}

my (@remote, @local);
# real processing starts here
$\ = $/;
my $sep = $conf{whitespace} ? ' ' : $\;

my $j = $main->structures();


if($j == 0 || $j eq "any"){

print $main->help;
exit(0);
}

sub is_integer {
   defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
}


sub cleanArgs{
    my ($key) = @_;
    my @tmp=();
    foreach(@ARGV){
    push @tmp,$_ unless($_=~/$key/);}

    @ARGV=@tmp;
}



my $structure;

if(defined($ARGV[0]) && $ARGV[0] =~ m/structures/){



    @local = grep{!/any/}AI::MicroStructure->new()->structures();

    if(defined($ARGV[1]) && is_integer($ARGV[1])){
      my $index = rand $#local;
         $index = $index-$ARGV[1];
                  $index = $index?$index:0;
      @local = @local[$index+1..$index+$ARGV[1]];

    }

    my $val = sprintf "%s",join $sep, @local, @remote;
    $memd->set($argkey,$val);
    print "$val";
     exit;
}

if(defined($ARGV[0]) && $ARGV[0] =~ m/structures/){



    @local = grep{!/any/}AI::MicroStructure->new()->structures();

    if(defined($ARGV[1]) && is_integer($ARGV[1])){
      my $index = rand $#local;
         $index = $index-$ARGV[1];
                  $index = $index?$index:0;
      @local = @local[$index+1..$index+$ARGV[1]];

    }

    my $val = sprintf "%s", join $sep, @local, @remote;
    $memd->set($argkey,$val);

    print "$val";
    exit;

}

if($conf{"new"} and $ARGV[0] !~/structures/  and $ARGV[0] =~ m{^([^/]+)/(.*)}s) {
    $structure          = $1;
    $conf{category} = $2;

    my $meta = AI::MicroStructure->new( $structure, category => "new" );
    $memd->set($argkey,$meta);
     p $meta;
    exit;
}



if(!$conf{"drop"} && !$conf{"write"}and $ARGV[0] !~/structures/){



# find out the structure name
$structure = shift || $AI::MicroStructure::structure;

if (!length $conf{category} && $structure =~ m{^([^/]+)/(.*)}s) {
    $structure          = $1;
    $conf{category} = $2;
}


AI::MicroStructure->new( $structure, category => "new" )
 unless AI::MicroStructure->has_structure( $structure );

# my $module = "AI::MicroStructure::$structure";
my $module = "$absstructdir/$structure.pm";

if(!-f $module){
print "no\n\e[00;33m $module\e[00m";
print "create like\n\e[00;33mmicro $structure new verbose\e[00m";

exit;
}

# load the remote structure if needed
if ( $conf{remote} || $conf{check} || $conf{sources}) {
    eval "require '$module';";
    die "structure '$structure' is not updatable!\n"
        unless $module->has_remotelist();
}

# informative options
print STDERR
"meta, a simple front-end to AI::MicroStructure version $AI::MicroStructure::VERSION\n"
  if $conf{version};
print STDERR $main->help if $conf{help};

print map "$_\n", AI::MicroStructure->structures if $conf{structures};

if ( $conf{sources} ) {
    my @sources = $module->sources( $conf{category} );


    my $var = map "$_\n", @sources;

    $memd->set($argkey,$var);
    print $var;
    exit;

}
exit if $conf{structures} || $conf{version} || $conf{help} || $conf{sources};


my $meta = AI::MicroStructure->new( $structure, category => $conf{category} );

@remote = $module->remote_list( $conf{category} )
    if $conf{remote} || $conf{check};
if ( !$conf{remote} ) {
    my $count = shift;
    $count = 1 unless defined $count;
    $count = 0 if $conf{check};

    if($all){
    @local = $meta->name(0,scalar "");
    }else{
    @local = $meta->name($count);
    }
}
if ( $conf{check} ) {
    my %seen;
    $seen{$_}++ for @remote;
    $seen{$_}-- for @local;
    foreach my $key ( sort keys %seen ) {
        next unless $seen{$key};
        print $seen{$key} > 0 ? "+ $key" : "- $key";
    }
}
else {
    my $val = sprintf "%s" ,join $sep, @local, @remote;
    $memd->set($argkey,$val);
    print "$val";
    exit;
}

}

END{
   # print Dumper  [$structure,\@ARGV,%conf,$argkey];
}


1;

bin/micro-dict  view on Meta::CPAN

#!/bin/bash
IFS=$'\n';

#REMOVETHESE="gov|search|cid|aaa|bbb|ccc|ddd|eee|fff|ggg|hhh|iii|jjj|kkk|lll|mmm|nnn|ooo|ppp|qqq|rrr|sss|ttt|eee|fff|ggg|hhh|iii|jjj|kkk|lll|mmm|nnn|ooo|ppp|qqq|rrr|sss|ttt|uuu|vvv|www|xxx|yyy|zzz|org|wiki|png|jpg|thumb|pdf|ref|idx|php|html|json|abc|...
#  egrep -v "($REMOVETHESE)" |

                                    #+ options to sort. Changed from




stop=$(perl -MAI::MicroStructure::WordBlacklist -E  "my \$s=AI::MicroStructure::WordBlacklist::getStopWords('de'); my @s = keys %\$s; print join('|',@s);")



function uniquemmasher(){

if [ -f "$1" ]
then                                #+ valid file argument.
cmd=cat
else
cmd=echo
fi



stop=$(perl -MAI::MicroStructure::WordBlacklist -E  "my \$s=AI::MicroStructure::WordBlacklist::getStopWords('de'); my @s = keys %\$s; print join('|',@s);")
IFS=$'\n';

$cmd $1 |   tr A-Z a-z |                # Convert to lowercase.
        tr ' ' '_' |             # New: change spaces to newlines.
       #tr -cd '\012[a-z][0-9]' |   #  Get rid of everything
                                    #+ non-alphanumeric (in orig. script).
        tr -c '\012a-z'  '\012' |   #  Rather than deleting non-alpha
        egrep -v '^#' |              # Delete lines starting with hashmark.
        egrep -v "^[ ]*([A-Za-z][A-Za-z]|[A-Za-z])$" | egrep -v "^$" | egrep -v -i "^ (denkbarer|ganze|bez|ver�ffentlichtes|uns�gliches|ungew�hnliche|vollstaendig|erstem|Inf.|titel|unsaeglichem|beforehand|denkbares|yours|contains|gedurft|seithe...


 stop=$(perl -MAI::MicroStructure::WordBlacklist -E  "my \$s=AI::MicroStructure::WordBlacklist::getStopWords('de'); my @s = keys %\$s; print join('|',@s);")

 cat /tmp/micro-dict.tmp | sort -n | egrep -v "^.*.[\ ].*.[1-9][\:][\ ][\ ]($stop)";


 #if [ !  "$(echo  "$stop" | egrep -i zzzzzzzzzzzz)" ]; then  echo cool; fi




}

function masher(){

if [ -f "$1" ]
then                                #+ valid file argument.
cmd=cat
else
cmd=echo
fi

$cmd $1 | tr A-Z a-z |                # Convert to lowercase.
        tr ' ' '\012' |             # New: change spaces to newlines.
   #    tr -cd '\012[a-z][0-9]' |   #  Get rid of everything
                                    #+ non-alphanumeric (in orig. script).
        tr -c '\012a-z'  '\012' |   #  Rather than deleting non-alpha
                                    #+ chars, change them to newlines.
        egrep -v '^#' |              # Delete lines starting with hashmark.
        egrep -v "^[ ]*([A-Za-z][A-Za-z]|[A-Za-z])$" |
        egrep -v '^$'




}


if [ "$2" == 1 ]                    #  Need at least one
then
uniquemmasher $*;
else
masher $*;
fi
exit 0

bin/micro-dict~  view on Meta::CPAN

#!/bin/bash
IFS=$'\n';

#REMOVETHESE="gov|search|cid|aaa|bbb|ccc|ddd|eee|fff|ggg|hhh|iii|jjj|kkk|lll|mmm|nnn|ooo|ppp|qqq|rrr|sss|ttt|eee|fff|ggg|hhh|iii|jjj|kkk|lll|mmm|nnn|ooo|ppp|qqq|rrr|sss|ttt|uuu|vvv|www|xxx|yyy|zzz|org|wiki|png|jpg|thumb|pdf|ref|idx|php|html|json|abc|...
#  egrep -v "($REMOVETHESE)" |

                                    #+ options to sort. Changed from




stop=$(perl -MAI::MicroStructure::WordBlacklist -E  "my \$s=AI::MicroStructure::WordBlacklist::getStopWords('de'); my @s = keys %\$s; print join('|',@s);")



function uniquemmasher(){

if [ -f "$1" ]
then                                #+ valid file argument.
cmd=cat
else
cmd=echo
fip



stop=$(perl -MAI::MicroStructure::WordBlacklist -E  "my \$s=AI::MicroStructure::WordBlacklist::getStopWords('de'); my @s = keys %\$s; print join('|',@s);")

res=$($cmd $1 |   tr A-Z a-z |                # Convert to lowercase.
        tr ' ' '_' |             # New: change spaces to newlines.
        tr -c '\012a-z'  '\012' |   #  Rather than deleting non-alpha
        egrep -v "^[ ]*([A-Za-z][A-Za-z]|[A-Za-z])$" | egrep -v "^$");



             echo "$res"




}

function masher(){

if [ -f "$1" ]
then                                #+ valid file argument.
cmd=cat
else
cmd=echo
fi

$cmd $1 | tr A-Z a-z |                # Convert to lowercase.
        tr ' ' '\012' |             # New: change spaces to newlines.
   #    tr -cd '\012[a-z][0-9]' |   #  Get rid of everything
                                    #+ non-alphanumeric (in orig. script).
        tr -c '\012a-z'  '\012' |   #  Rather than deleting non-alpha
                                    #+ chars, change them to newlines.
        egrep -v '^#' |              # Delete lines starting with hashmark.
        egrep -v "^[ ]*([A-Za-z][A-Za-z]|[A-Za-z])$" |
        egrep -v '^$'




}


if [ "$2" == 1 ]                    #  Need at least one
then
uniquemmasher $*;
else
masher $*;
fi
exit 0

bin/micro-leo  view on Meta::CPAN

#!/bin/sh

onetwo='.{1,2}'
re="$1"
re="${re//[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/.}"
re="${re//ue/$onetwo}"
re="${re//ae/$onetwo}"
re="${re//oe/$onetwo}"
re="${re//ss/$onetwo}"

# have to use perl for grepping because of umlauts

lynx -dump -nolist  'http://dict.leo.org/'$2$3'?lp='$2$3'&lang='$2'&searchLoc=0&cmpType=strict&sectHdr=on&spellToler=on&search='$1'&relink=on' | perl -n -e "print if /$re/i;"

bin/micro-relation  view on Meta::CPAN

#!/usr/bin/perl -X

use JSON;
use JSON::XS;
use Data::Printer;
use Data::Dumper;
use WWW::Wikipedia;
use Try::Tiny;
my $lang =  $ENV{MICRO_LANG} || "en" ;

my $wiki = WWW::Wikipedia->new(language => $lang);



use Cache::Memcached::Fast;

         our $memd = new Cache::Memcached::Fast({
             servers => [ { address => 'localhost:11211', weight => 2.5 }],
             namespace => 'my:',
             connect_timeout => 0.2,
             io_timeout => 0.1,
             close_on_error => 1,
             compress_threshold => 100_000,
             compress_ratio => 0.9,
             max_failures => 1,
             max_size => 512 * 1024,
         });




sub  decruft  {
  my($file)  =  @_;
  my($cruftSet)  =  q{%§&|#[^+*(]),'";};
  my  $clean  =  $file;
  $clean=~s/\Q$_//g  for  split("",$cruftSet);

  return  $clean;
}


sub rel {
  my $arg = shift;
  my $lang = shift;


  if(defined(my $fromCache = $memd->get($arg))){
    return $fromCache;
  }

  my $result = $wiki->search($arg);
  my $str = "";

  if (defined($result) &&  $result->text() ) {

    try{
    $str = join( "\n", $result->related() );
    $str = decruft($str);
    $memd->set($arg,$str);
    };
  }
  return $str;
}

try{
print rel(eval qw{$_}, $lang)  for @ARGV;
};
#

1;
__DATA__

bin/micro-relation-test  view on Meta::CPAN

#!/usr/bin/perl -X

use JSON;
use JSON::XS;
use Data::Printer;
use Data::Dumper;
use WWW::Wikipedia;
use Try::Tiny;
my $lang =  $ENV{MICRO_LANG} || "en" ;

my $wiki = WWW::Wikipedia->new(language => $lang);


use Cache::Memcached::Fast;

         my $memd = new Cache::Memcached::Fast({
             servers => [ { address => 'localhost:11211', weight => 2.5 }],
             namespace => 'my:',
             connect_timeout => 0.2,
             io_timeout => 0.5,
             close_on_error => 1,
             compress_threshold => 100_000,
             compress_ratio => 0.9,
             compress_methods => [ \&IO::Compress::Gzip::gzip,
                                   \&IO::Uncompress::Gunzip::gunzip ],
             max_failures => 3,
             failure_timeout => 2,
             ketama_points => 150,
             nowait => 1,
             hash_namespace => 1,
             serialize_methods => [ \&Storable::freeze, \&Storable::thaw ],
             utf8 => ($^V ge v5.8.1 ? 1 : 0),
             max_size => 512 * 1024,
         });





sub  decruft  {
  my($file)  =  @_;
  my($cruftSet)  =  q{%§&|#[^+*(]),'";};
  my  $clean  =  $file;
  $clean=~s/\Q$_//g  for  split("",$cruftSet);

  return  $clean;
}


sub rel {

  my ($arg,$lang)  = @_;

  my $result = $wiki->search($arg);
  my $str = "";

  if (defined($result) &&  $result->text() ) {

    $str = join( "\n", $result->related() );


  }
  return $str;
}


foreach my $call(@ARGV)
{


   my $fromCache = $memd->get($call);


  if($fromCache){

    print $fromCache;


  }else{

    my $str = rel($call, $lang);

    $memd->set($call,$str);
  }
}

#

1;
__DATA__

bin/micro-rename  view on Meta::CPAN

#!/bin/bash
IFS_BAK=$IFS;
IFS=$'\n';

# blank-rename.sh
#
# Substitutes underscores for blanks in all the filenames in a directory.
filename=$1
ONE=1                     # For getting singular/plural right (see below).
number=0                  # Keeps track of how many files actually renamed.
FOUND=0                   # Successful return value.

fname=$1                      # Yes, this filename needs work.
n=`echo $fname | sed -e "s/ /_/g" | sed -e "s/'//g" | sed -e "s/&/and/g"  | tr A-Z a-z | sed -e "s/)/_/g"  | sed -e "s/(/_/g" | sed -e "s/\[//g" | sed -e "s/\]//g"  | sed -e "s/\,//g" | sed -e "s/\;//g"`   #
#        | sed -e "s/[/_/g" | sed -e "s/]//g" | sed -e "s/)//g" | sed -e "s/(//g"`

mv "$1" "$n"       > /dev/null;





IFS=$IFS_BAK;



exit 0

bin/micro-sense  view on Meta::CPAN

#!/usr/bin/perl -X
use strict;
use AnyDBM_File;
use Fcntl;
use Data::Dumper;
use JSON;
use AI::MicroStructure::WordBlacklist;


my @set;
my $data = {};
my %structure;
my $fresh=1;
my $wn;
my $debug = 0;
my $words = 1;
my $count = 0;

if( grep{/\bdebug\b/} @ARGV ){$debug = 1; cleanArgs("debug"); };
if( grep{/\bwords\b/} @ARGV ){$words = 1; cleanArgs("words"); };


sub cleanArgs{
    my ($key) = @_;
    my @tmp=();
    foreach(@ARGV){
    push @tmp,$_ unless($_=~/$key/);}

    @ARGV=@tmp;
}

# convert to lower case, translate ' ' to '_' and eliminate any
# syntactic marker
sub lower#
{
    my $word = shift;
    $word =~ tr/A-Z /a-z_/;
    $word =~ s/\(.*\)$//;
    return $word;
}

# translate ' ' to '_'
sub underscore#
{
    $_[0] =~ tr/ /_/;
    return $_[0];
}

# Eliminate any syntactic marker
sub delMarker#
{
    $_[0] =~ s/\(.*\)$//;
    return $_[0];
}


sub trim
{
  my $string = shift;
  $string =  "" unless  $string;
  $string =~ s/^\s+//;
  $string =~ s/\s+$//;
  $string =~ s/\t//;
  $string =~ s/^\s//;
  return $string;
}

$structure{"x",1} = "\nData: Hello, my name is Data!\nThank you for reactivating me !";
$structure{"x",2} = "\nData: My post-hypnotic positron inducer  signals all systems within normal parameters!\n";
$structure{"x",3} = "\nData: Please think of an category and I will try to get some structures to it - press enter when ready\n";

sub forms
{
    my ($string) = shift;
    # The query string (word, pos and sense #)
    my ($word, $pos, $sense) = $string =~ /^([^\#]+)(?:\#([^\#]+)(?:\#(\d+))?)?$/;

    return $string;
}


sub intro {

 return sort grep{/^\nData: /} %structure;
}

my @s=AI::MicroStructure::WordBlacklist::getStopWordsSmall();
my $search = "(".join("|",@s).")";
$search =~ s/\'/\\'/g;
my $line = "";
my @xset;
$line = $ARGV[0];

#while($count++ < 2) {

  if($count==1 && !$line){

    print intro();
    next;

  }

   chomp($line = <STDIN>) unless($line);

   @set=();
   $wn = `wn $line -over -hypen -hypon -synsn -smemn -membn -subsn -meron -holon -derin -domnn -famln -coorn -hmern -grepn`;

 # print forms($wn);
#   die;



   foreach(split("\n",$wn)){
    if($_ =~ /^([0-9].*?)[.](.*?)$/){
      my($sense,$text)=($1,$2);
      my @set = map{$_=~s/"|'|`//g; trim($_)}grep{/[a-z|A-Z]/}split("\\(|--|\\)|; \"",$text);
      push @{$data->{'senses'}->{$sense}->{"basics"}},@set;



    }
  }


  #last if $line =~ /quit/;

  #next if $line =~ /^[a-z|A-Z]/i;


 # redo;
#}

#//map{$_=map{ trim($_)}split("=>",$_)unless($_=~/Coordinate Terms/)}
#print Dumper [split("sense",`wn $line  -coorn`)];
push @{$data->{'search'}},grep{/[a-z|A-Z]/}split("\n|,",lc `micro-wnet $line words`) unless(!$words);
#push @{$data->{'coordinate'}},map{$_=trim($_); @_=grep(/[A-Z]|[0-9]|[a-z]/,map{$_=trim($_)}split("\n|=>",$_))}split(/Sense/,`wn $line -coorn`) unless(!$words);
#shift @{$data->{'coordinate'}} &&  shift @{$data->{'search'}} for(0..1);
#@{$data->{'search'}};
END{

 $data = {"rows"=>$data,"senses"=>[sort keys %{$data->{'senses'}}]};


   my $utf8_encoded_json_text = encode_json($data);

  if($debug == 1) {
    print Dumper $data,$wn;
  }


  print $utf8_encoded_json_text;

}

bin/micro-soundex  view on Meta::CPAN

#!/usr/bin/perl

use File::Copy;
use Data::Dumper;
use Data::Printer;
sub soundex
{

p 	@_;
    my $dir = `pwd | tr -d "\n"`;
    my $file = shift; 
    push @_,$file;
    local( @res ) = map {$_=$_}@_; local($i, $t,$_); 
    for ( @res ) { tr/a-zA-Z//cd; tr/a-zA-Z/A-ZA-Z/s;
    	($i,$t) = /(.)(.*)/;
       $t =~ tr/BFPVCGJKQSXZDTLMNRAEHIOUWY/111122222222334556/sd;
       $_ = substr(($i||'Z').$t.'000', 0, 4 );
       
    }
    my $maindir = substr($res[0],0,1);
    my $targetdir = sprintf("%s/%s/%s",$dir, $maindir,substr($res[0],0,2));
    if(! -d $targetdir){
 #     `mkdir -p $targetdir`;
    }
#    move($file,$targetdir);
    return [$dir,$targetdir,@res,substr($res[0],0,2),$file];
}


#print Dumper glob '*/*json';

print Dumper soundex(@ARGV);

bin/micro-steemer  view on Meta::CPAN

#!/bin/bash
IFS_BAK=$IFS;
IFS=$'\n';

mkdir -p /tmp/test/pages;
pdftotext "$1" "$2";
#pdftohtml -i "$1" "$2.html";
#mv "$2" /tmp/test/pages;
#mv "$2.*.html" /tmp/test/pages;
#mv "$2.*.png" /tmp/test/pages;
#mv "$2.*.jpg" /tmp/test/pages;

FROM="$1"
TO="$2"

#awk '/MARKER/{n++}{print > ".out" n }' "$TO.txt";

bin/micro-wiki  view on Meta::CPAN

#!/usr/bin/perl -w
use utf8;
use File::Basename;
use Data::Printer;
use Data::Dumper;
use Parallel::Iterator qw( iterate );
use Env qw/PWD/;
use JSON::XS;
use HTML::Strip;
use AI::MicroStructure::Util;
use WWW::Wikipedia;
use LWP::UserAgent;
use HTML::SimpleLinkExtor;
use URI::Escape qw( uri_unescape );
our $e = HTML::SimpleLinkExtor->new;

binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';


my $state  = AI::MicroStructure::Util::config();

my @CWD    = $state->{cwd};
our $config = $state->{cfg};


die("require a argument") unless($ARGV[0]);

our $doc ={};
our @links;
our $linkdata = {};
our $result;
our $odir = "";

    
my $url = $ARGV[0];
my @inx;
my @test;
my $search="";

my $TOP="wikipedia";
my $carry = {count=>0,max=>0};


sub nicefy { return reverse sort {length($a) <=> length($b)}@_ }
sub quantify {my	 $base = {}; map{$base->{$_} = $base->{$_}?$base->{$_}+1:1}@_;  return $base; }#return reverse sort {length($a) <=> length($b)}@_ }


sub list_iter {
           my @ar = @_;
           my $pos = 0;
           return sub {
               return if $pos >= @ar;
               my @r = ( $pos, $ar[$pos] );  # Note: returns ( index, value )
               $pos++;
               return @r;
           };
       }

sub down_iter {
           my @ar = @_;
           my $pos = 0;
           return sub {
               return if $pos >= @ar;
               my @r = ( $pos, $ar[$pos] );  # Note: returns ( index, value )
               $pos++;
               return @r;
           };
       }


sub checkIsThere {

return 0;
}

sub URLDecode {
my $theURL = $_[0];
$theURL =~ tr/+/ /;
$theURL =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg;
$theURL =~ s/<!--(.|\n)*-->//g;
return $theURL;
}

sub URLEncode {
my $theURL = $_[0];
$theURL =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
return $theURL;
}

sub smartdecode {
use URI::Escape qw( uri_unescape );
use utf8;
my $x = my $y = uri_unescape($_[0]);
return $x if utf8::decode($x);
return $y;
}

sub imgTranslate {

my ($idx,$url) = @_;

print $idx;
print $url;
if($url){


my $ua = LWP::UserAgent->new;


$response  = $ua->get(sprintf("%s%s",$config->{wikipedia}, ucfirst($url)));


  $e->parse($response->decoded_content);

  return $e->links;
}
}



sub call  {

my ($idx,$url) = @_;

my $ua = LWP::UserAgent->new;


my $content ;
my $response ="";
my @book = ();


      $response  = $ua->get(sprintf("%s%s",$config->{wikipedia}, ucfirst($url)));

      my $doc={};
      my $linkdata={};




      my $wiki = WWW::Wikipedia->new();
      my $hs = HTML::Strip->new();

      my $result = $wiki->search(ucfirst $url);
      if (defined($result) && $result->text() ) {

      my $clean_text = $hs->parse($result->text() );
      $hs->eof;

      require HTML::SimpleLinkExtor;
      no warnings 'utf8';
      my $e = HTML::SimpleLinkExtor->new();
      $e->parse($response->decoded_content);


      my @all_links = $e->links;
      my @tags= map{$_=lc($_); $_=~s/\)|\/wiki\///g; $_=~s/ /_/g; $_=[split("_\\(",$_)] }grep {/([(].+?[)]|$url)/}@all_links ;# $result->related();
      my @audio = grep{/^(\/\/|upload|http).*.(mp3|wave|ogg|OGG|WAVE|MP3)$/}@all_links;
      my @pdf = grep{/^(\/\/|upload|http).*.(pdf|PDF)$/}@all_links;
      my @book = grep{/books.google/i}@all_links;
         foreach(@tags){
            if($_->[1] && $_->[1]!~/\W/){
              $doc->{tags}->{$_->[1]}->{$_->[0]} = $doc->{tags}->{$_->[1]}->{$_->[0]} ? $doc->{tags}->{$_->[1]}->{$_->[0]} +1:1;
            }
         }

          $doc->{image}=[map{$_="http:$_"; }grep{/[1-9][0-9][0-9]px/}$e->img];
          $doc->{cat}=[grep{/^.*.(Kategory|Category)+?/}@all_links];
          $doc->{cat}=[sort grep{!/(category|wikipedia|article|page|List.*.of)/i}map{$a=$_; $a =~ s/^.*.://g; $_=$a;}@{$doc->{cat}}];
          $doc->{list}=[grep{/List.*.of_/}@all_links];
          $doc->{list}=[sort map{$a=$_; $a=~ s/^.*.List/List/g; $_=$a;}@{$doc->{list}}];
          
      
          $doc->{book}= [@book] unless(!@book);
          $doc->{pdf}= [@pdf] unless(!@pdf);
          $doc->{audio}= [@audio] unless(!@audio);
          $doc->{related} = quantify $result->related();
          $doc->{links} = [sort grep{/http/}@all_links];
          
        


         
        #eval '$couchdb->store("$url" ,$doc)' or warn "error: $@\n";

      # createJsonFile($url,$doc);
    p $doc;

    return $doc;

}


}



our @out = ();
foreach my $urlx (@ARGV) {


if($urlx) { $result->{$urlx} = call(0,$urlx); }




}



1;

__DATA__

bin/micro-wnet  view on Meta::CPAN

#! /bin/bash
if [ "$1" == "" ] ; then
echo "you need a word you want to check"
exit 0;
fi

wn $1 -hypon -hypen -synsv -synsn | sed 's/Sense/Sense~~~~~~~~~/g' | sed 's/[[:space:]]*=> / /' | sed '/^$/d' | sed 's/ //'  | sed 's/,/, /' | sed 's/HAS INSTANCE//g';

bin/micrownet  view on Meta::CPAN

#! /bin/bash
for i in $@; do
wn $i  -hypon -hypen -synsv -synsn -hypen -synsv -synsn -synsa -grepn -grepa -grepv -synsa -perta -deria -famla -grepv -derin -famln |
 sed 's/[[:space:]]*=> / /' | sed 's/HAS INSTANCE//g' | egrep -v "(Synonyms|Hypernyms|Grep|The |*.[ ]of[ ].*|Overview|Hyponyms|noun|[1-9]|^(\W+))" |
sed '/^$/d' | sed 's/ /_/g'| sed 's/,_/\n/g' | sort -u | egrep "(^$i|[_]$i)";
done;


#
#echo -e "\n"$i,$xx;
#
#

bin/newssearch  view on Meta::CPAN

mojo get "https://www.google.com/search?q="$1"&tbm=nws&aqs=chrome..69i57j69i60.211j0j1&sourceid=chrome&es_sm=122&ie=UTF-8" a attr href | egrep "^\/url" | sed -s "s/^.*.q=http/http/" | sed -s "s/\&sa=.*$//"| grep -v google

bin/pdflinks  view on Meta::CPAN

IFS=$'\n';
pat="Category"

url="http://en.wikipedia.org/wiki/$1"

if [[ $1 =~ $pat ]]; then
  url="http://en.wikipedia.org/wiki/$1";
else
  url="http://en.wikipedia.org/wiki/Category:$1";
fi

echo $url;


for i in $(mojo get "$url" a attr href | sort -u | egrep "^\/wiki\/[A-Z]" | egrep -v "Portal|Wikipedia|Special:|Help:|Main_Page" | sed -s "s/\/wiki\///");
do

if [[ $i =~ $pat ]]; then
  echo -e "\t\t\t./$0 $i"
  
  #./pdflinks $i
  
else
  echo $i;
fi
done

#url=$(echo "http://en.wikipedia.org/wiki/"$i); 
#for ii in `mojo get $url a attr href | egrep pdf$ | sort -R`; do
#  echo echo wget -rc "$ii"; done done

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.445 second using v1.00-cache-2.02-grep-82fe00e-cpan-cec75d87357c )