Copy disabled (too large)
Download .txt
Showing preview only (83,447K chars total). Download the full file to get everything.
Repository: clips/pattern
Branch: master
Commit: d25511f9ca7e
Files: 398
Total size: 79.5 MB
Directory structure:
gitextract_3rltpp20/
├── .gitignore
├── .pylintrc
├── .travis.yml
├── LICENSE.txt
├── README.md
├── __init__.py
├── docs/
│ ├── clips.css
│ ├── html/
│ │ ├── mbsp-tags.html
│ │ ├── pattern-canvas.html
│ │ ├── pattern-db.html
│ │ ├── pattern-de.html
│ │ ├── pattern-dev.html
│ │ ├── pattern-en.html
│ │ ├── pattern-es.html
│ │ ├── pattern-fr.html
│ │ ├── pattern-graph.html
│ │ ├── pattern-it.html
│ │ ├── pattern-metrics.html
│ │ ├── pattern-nl.html
│ │ ├── pattern-search.html
│ │ ├── pattern-shell.html
│ │ ├── pattern-vector.html
│ │ ├── pattern-web.html
│ │ ├── pattern.html
│ │ └── stop-words.html
│ ├── index.html
│ ├── js/
│ │ ├── shBrushJScript.js
│ │ ├── shBrushPython.js
│ │ ├── shBrushXml.js
│ │ ├── shCore.css
│ │ ├── shCore.js
│ │ └── shThemeDefault.css
│ └── update.py
├── examples/
│ ├── 01-web/
│ │ ├── 01-google.py
│ │ ├── 02-google-translate.py
│ │ ├── 03-bing.py
│ │ ├── 04-twitter.py
│ │ ├── 05-twitter-stream.py
│ │ ├── 06-feed.py
│ │ ├── 07-wikipedia.py
│ │ ├── 08-wiktionary.py
│ │ ├── 09-wikia.py
│ │ ├── 10-dbpedia.py
│ │ ├── 11-facebook.py
│ │ ├── 12-dom.py
│ │ ├── 13-crawler.py
│ │ ├── 14-flickr.py
│ │ └── 15-sort.py
│ ├── 02-db/
│ │ ├── 01-database.py
│ │ ├── 02-datasheet.py
│ │ ├── 03-date.py
│ │ └── food.txt
│ ├── 03-en/
│ │ ├── 01-inflect.py
│ │ ├── 02-quantify.py
│ │ ├── 03-parse.py
│ │ ├── 04-tree.py
│ │ ├── 05-tagset.py
│ │ ├── 06-wordnet.py
│ │ ├── 07-sentiment.py
│ │ ├── 08-topmine_ngrammer.py
│ │ └── texts/
│ │ ├── 1701.00002.txt
│ │ ├── 1701.00003.txt
│ │ ├── 1701.00004.txt
│ │ ├── 1701.00005.txt
│ │ ├── 1701.00006.txt
│ │ ├── 1701.00007.txt
│ │ ├── 1701.00008.txt
│ │ ├── 1701.00009.txt
│ │ ├── 1701.00010.txt
│ │ ├── 1701.00011.txt
│ │ ├── 1701.00012.txt
│ │ ├── 1701.00013.txt
│ │ ├── 1701.00014.txt
│ │ ├── 1701.00015.txt
│ │ ├── 1701.00016.txt
│ │ ├── 1701.00017.txt
│ │ ├── 1701.00018.txt
│ │ ├── 1701.00019.txt
│ │ ├── 1701.00020.txt
│ │ ├── 1701.00021.txt
│ │ ├── 1701.00022.txt
│ │ ├── 1701.00023.txt
│ │ ├── 1701.00024.txt
│ │ ├── 1701.00025.txt
│ │ ├── 1701.00026.txt
│ │ ├── 1701.00027.txt
│ │ ├── 1701.00028.txt
│ │ ├── 1701.00029.txt
│ │ ├── 1701.00030.txt
│ │ ├── 1701.00031.txt
│ │ ├── 1701.00032.txt
│ │ ├── 1701.00033.txt
│ │ ├── 1701.00034.txt
│ │ ├── 1701.00035.txt
│ │ ├── 1701.00037.txt
│ │ ├── 1701.00038.txt
│ │ ├── 1701.00039.txt
│ │ ├── 1701.00043.txt
│ │ ├── 1701.00044.txt
│ │ ├── 1701.00045.txt
│ │ ├── 1701.00046.txt
│ │ ├── 1701.00047.txt
│ │ ├── 1701.00049.txt
│ │ ├── 1701.00050.txt
│ │ ├── 1701.00051.txt
│ │ ├── 1701.00052.txt
│ │ ├── 1701.00053.txt
│ │ ├── 1701.00054.txt
│ │ ├── 1701.00055.txt
│ │ ├── 1701.00056.txt
│ │ ├── 1701.00057.txt
│ │ ├── 1701.00058.txt
│ │ ├── 1701.00060.txt
│ │ ├── 1701.00061.txt
│ │ ├── 1701.00062.txt
│ │ ├── 1701.00063.txt
│ │ ├── 1701.00064.txt
│ │ ├── 1701.00065.txt
│ │ ├── 1701.00066.txt
│ │ ├── 1701.00067.txt
│ │ ├── 1701.00068.txt
│ │ ├── 1701.00069.txt
│ │ ├── 1701.00072.txt
│ │ ├── 1701.00073.txt
│ │ ├── 1701.00074.txt
│ │ ├── 1701.00075.txt
│ │ ├── 1701.00076.txt
│ │ ├── 1701.00077.txt
│ │ ├── 1701.00078.txt
│ │ ├── 1701.00079.txt
│ │ ├── 1701.00081.txt
│ │ ├── 1701.00082.txt
│ │ ├── 1701.00083.txt
│ │ ├── 1701.00084.txt
│ │ ├── 1701.00085.txt
│ │ ├── 1701.00086.txt
│ │ ├── 1701.00087.txt
│ │ ├── 1701.00088.txt
│ │ ├── 1701.00089.txt
│ │ ├── 1701.00090.txt
│ │ ├── 1701.00091.txt
│ │ ├── 1701.00092.txt
│ │ ├── 1701.00094.txt
│ │ ├── 1701.00095.txt
│ │ ├── 1701.00096.txt
│ │ ├── 1701.00097.txt
│ │ ├── 1701.00098.txt
│ │ ├── 1701.00099.txt
│ │ ├── 1701.00100.txt
│ │ ├── 1701.00101.txt
│ │ ├── 1701.00102.txt
│ │ ├── 1701.00103.txt
│ │ ├── 1701.00104.txt
│ │ ├── 1701.00105.txt
│ │ ├── 1701.00106.txt
│ │ ├── 1701.00107.txt
│ │ ├── 1701.00109.txt
│ │ ├── 1701.00110.txt
│ │ ├── 1701.00111.txt
│ │ └── 1701.00112.txt
│ ├── 04-search/
│ │ ├── 01-search.py
│ │ ├── 02-constraint.py
│ │ ├── 03-lemmata.py
│ │ ├── 04-taxonomy.py
│ │ ├── 05-multiple.py
│ │ ├── 06-optional.py
│ │ ├── 07-exclude.py
│ │ ├── 08-group.py
│ │ └── 09-web.py
│ ├── 05-vector/
│ │ ├── 01-document.py
│ │ ├── 02-model.py
│ │ ├── 03-lsa.py
│ │ ├── 04-KNN.py
│ │ ├── 05-nb.py
│ │ ├── 06-svm.py
│ │ ├── 07-slp.py
│ │ └── corpus/
│ │ ├── badger.txt
│ │ ├── bear.txt
│ │ ├── dog.txt
│ │ ├── dolphin.txt
│ │ ├── lion.txt
│ │ ├── parakeet.txt
│ │ ├── rabbit.txt
│ │ ├── shark.txt
│ │ ├── sparrow.txt
│ │ ├── tiger.txt
│ │ └── wolf.txt
│ ├── 06-graph/
│ │ ├── 01-graph.py
│ │ ├── 02-export.py
│ │ ├── 03-template.py
│ │ ├── 04-canvas.html
│ │ ├── 05-trends.py
│ │ ├── 06-commonsense.py
│ │ ├── 07-graphml.py
│ │ └── test.graphml
│ ├── 07-canvas/
│ │ ├── 01-basic.html
│ │ ├── 02-basic.html
│ │ ├── 03-transformation.html
│ │ ├── 04-path.html
│ │ ├── 05-points.html
│ │ ├── 06-image.html
│ │ ├── 08-widget.html
│ │ ├── 09-class.html
│ │ ├── 10-pack.html
│ │ ├── 11-graph.html
│ │ └── data-url.html
│ └── 08-server/
│ ├── 01-basic/
│ │ └── basic.py
│ ├── 02-api/
│ │ └── api.py
│ ├── 03-wiki/
│ │ ├── data/
│ │ │ └── index.html.txt
│ │ └── wiki.py
│ └── 04-db/
│ └── db.py
├── pattern/
│ ├── __init__.py
│ ├── canvas.js
│ ├── db/
│ │ └── __init__.py
│ ├── graph/
│ │ ├── __init__.py
│ │ ├── commonsense.csv
│ │ ├── commonsense.py
│ │ └── graph.js
│ ├── helpers.py
│ ├── metrics.py
│ ├── server/
│ │ ├── __init__.py
│ │ └── static/
│ │ └── robots.txt
│ ├── text/
│ │ ├── __init__.py
│ │ ├── de/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── de-context.txt
│ │ │ ├── de-frequency.txt
│ │ │ ├── de-lexicon.txt
│ │ │ ├── de-morphology.txt
│ │ │ ├── de-spelling.txt
│ │ │ ├── de-verbs.txt
│ │ │ └── inflect.py
│ │ ├── en/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── en-context.txt
│ │ │ ├── en-entities.txt
│ │ │ ├── en-frequency.txt
│ │ │ ├── en-lexicon.txt
│ │ │ ├── en-model.slp
│ │ │ ├── en-morphology.txt
│ │ │ ├── en-sentiment.xml
│ │ │ ├── en-spelling.txt
│ │ │ ├── en-verbs.txt
│ │ │ ├── inflect.py
│ │ │ ├── inflect_quantify.py
│ │ │ ├── modality.py
│ │ │ ├── wordlist/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── academic.txt
│ │ │ │ ├── basic.txt
│ │ │ │ ├── profanity.txt
│ │ │ │ ├── stopwords.txt
│ │ │ │ └── time.txt
│ │ │ └── wordnet/
│ │ │ ├── __init__.py
│ │ │ ├── dict/
│ │ │ │ ├── LICENSE.txt
│ │ │ │ ├── data.adj
│ │ │ │ ├── data.adv
│ │ │ │ ├── data.noun1
│ │ │ │ ├── data.noun2
│ │ │ │ ├── data.verb
│ │ │ │ ├── index.32
│ │ │ │ ├── index.adj
│ │ │ │ ├── index.adv
│ │ │ │ ├── index.noun
│ │ │ │ ├── index.sense
│ │ │ │ ├── index.verb
│ │ │ │ └── lexnames
│ │ │ ├── resnik-ic2.txt
│ │ │ └── resnik-ic3.txt
│ │ ├── es/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── es-context.txt
│ │ │ ├── es-frequency.txt
│ │ │ ├── es-lexicon.txt
│ │ │ ├── es-morphology.txt
│ │ │ ├── es-spelling.txt
│ │ │ ├── es-verbs.txt
│ │ │ └── inflect.py
│ │ ├── fr/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── fr-context.txt
│ │ │ ├── fr-frequency.txt
│ │ │ ├── fr-lexicon.txt
│ │ │ ├── fr-morphology.txt
│ │ │ ├── fr-sentiment.xml
│ │ │ ├── fr-spelling.txt
│ │ │ ├── fr-verbs.txt
│ │ │ └── inflect.py
│ │ ├── it/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── inflect.py
│ │ │ ├── it-context.txt
│ │ │ ├── it-frequency.txt
│ │ │ ├── it-lexicon.txt
│ │ │ ├── it-morphology.txt
│ │ │ ├── it-sentiment.xml
│ │ │ ├── it-spelling.txt
│ │ │ └── it-verbs.txt
│ │ ├── nl/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── inflect.py
│ │ │ ├── nl-context.txt
│ │ │ ├── nl-frequency.txt
│ │ │ ├── nl-lexicon.txt
│ │ │ ├── nl-morphology.txt
│ │ │ ├── nl-sentiment.xml
│ │ │ ├── nl-spelling.txt
│ │ │ └── nl-verbs.txt
│ │ ├── ru/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── ru-entities.txt
│ │ │ ├── ru-frequency.txt
│ │ │ ├── ru-lexicon.txt
│ │ │ ├── ru-model.slp
│ │ │ ├── ru-spelling.txt
│ │ │ └── wordlist/
│ │ │ ├── __init__.py
│ │ │ └── stopwords.txt
│ │ ├── search.py
│ │ ├── tree.py
│ │ └── xx/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── inflect.py
│ │ ├── xx-context.txt
│ │ ├── xx-frequency.txt
│ │ ├── xx-lexicon.txt
│ │ ├── xx-morphology.txt
│ │ ├── xx-sentiment.xml
│ │ └── xx-verbs.txt
│ ├── vector/
│ │ ├── __init__.py
│ │ ├── stemmer.py
│ │ ├── stopwords-de.txt
│ │ ├── stopwords-en.txt
│ │ ├── stopwords-es.txt
│ │ ├── stopwords-fr.txt
│ │ ├── stopwords-nl.txt
│ │ └── svm/
│ │ ├── COPYRIGHT-liblinear.txt
│ │ ├── COPYRIGHT-libsvm.txt
│ │ ├── INSTALL.txt
│ │ ├── README.txt
│ │ ├── __init__.py
│ │ ├── liblinear.py
│ │ ├── liblinearutil.py
│ │ ├── libsvm.py
│ │ ├── libsvmutil.py
│ │ ├── macos/
│ │ │ ├── liblinear-2.20/
│ │ │ │ └── liblinear.so.3
│ │ │ └── libsvm-3.22/
│ │ │ └── libsvm.so.2
│ │ └── ubuntu/
│ │ ├── liblinear-2.20/
│ │ │ └── liblinear.so.3
│ │ └── libsvm-3.22/
│ │ └── libsvm.so.2
│ └── web/
│ ├── __init__.py
│ ├── api.py
│ ├── cache/
│ │ └── __init__.py
│ ├── imap/
│ │ └── __init__.py
│ ├── locale/
│ │ └── __init__.py
│ ├── oauth/
│ │ └── __init__.py
│ └── utils.py
├── setup.py
└── test/
├── corpora/
│ ├── README.txt
│ ├── carroll-lookingglass.docx
│ ├── plagiarism-clough&stevenson.csv
│ ├── polarity-de-amazon.csv
│ ├── polarity-en-pang&lee1.csv
│ ├── polarity-en-pang&lee2.csv
│ ├── polarity-fr-amazon.csv
│ ├── polarity-nl-bol.com.csv
│ ├── spam-apache.csv
│ ├── spelling-birkbeck.csv
│ ├── spelling-ru.csv
│ ├── tagged-de-tiger.txt
│ ├── tagged-en-oanc.txt
│ ├── tagged-en-wsj.txt
│ ├── tagged-es-wikicorpus.txt
│ ├── tagged-fr-wikinews.txt
│ ├── tagged-it-wacky.txt
│ ├── tagged-nl-twnc.txt
│ ├── uncertainty-conll2010.csv
│ ├── wordforms-de-celex.csv
│ ├── wordforms-en-celex.csv
│ ├── wordforms-es-davies.csv
│ ├── wordforms-fr-lexique.csv
│ ├── wordforms-it-wiktionary.csv
│ └── wordforms-nl-celex.csv
├── test.html
├── test.js
├── test_canvas.js
├── test_db.py
├── test_de.py
├── test_en.py
├── test_es.py
├── test_fr.py
├── test_graph.js
├── test_graph.py
├── test_it.py
├── test_metrics.py
├── test_nl.py
├── test_ru.py
├── test_search.py
├── test_text.py
├── test_vector.py
└── test_web.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.pyc
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
.coveralls.yml
*.cover
.hypothesis/
# Sphinx documentation
docs/_build/
*.dev*
*.nja
build
dist
# Environments
.env
.venv
env/
venv/
ENV/
# Flymake
*_flymake.py
# Pattern specific ignore pattern
pattern/web/cache/tmp/
web/cache/tmp/
pattern_unittest_db
test/pattern_unittest_db
.DS_Store
================================================
FILE: .pylintrc
================================================
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
profile=no
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS, feed, json, pdf, soup, pywordnet, svm
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
disable=C0103,W0142,E1103
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format=text
# Include message's id in output
include-ids=yes
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match functions or classes name which do
# not require a docstring
no-docstring-rgx=__.*__
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
================================================
FILE: .travis.yml
================================================
language: python
dist: precise
python:
- "3.6"
before_install:
- export TZ=Europe/Brussels
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update --yes conda
- conda install --yes numpy scipy
- pip install --quiet pytest pytest-cov pytest-xdist chardet
install:
- python setup.py install --quiet
- pip freeze
# Install and compile libsvm and liblinear
- sudo apt-get install -y build-essential
- git clone https://github.com/cjlin1/libsvm
- cd libsvm; make lib; sudo cp libsvm.so.2 /lib; sudo ln -s /lib/libsvm.so.2 /lib/libsvm.so; cd ..
- git clone https://github.com/cjlin1/liblinear
- cd liblinear; make lib; sudo cp liblinear.so.3 /lib; sudo ln -s /lib/liblinear.so.3 /lib/liblinear.so; cd ..
script:
- pytest --cov=pattern
after_script:
- pip install --quiet coveralls
- coveralls
branches:
only:
- development
notifications:
email: false
# You can connect to MySQL/MariaDB using the username "travis" or "root" and a blank password.
services:
- mysql
================================================
FILE: LICENSE.txt
================================================
Copyright (c) 2011-2013 University of Antwerp, Belgium
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Pattern nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
Pattern
=======
[](https://travis-ci.org/clips/pattern/branches)
[](https://coveralls.io/github/clips/pattern?branch=master)
[](https://pypi.python.org/pypi/pattern)
[](https://github.com/clips/pattern/blob/master/LICENSE.txt)
Pattern is a web mining module for Python. It has tools for:
* Data Mining: web services (Google, Twitter, Wikipedia), web crawler, HTML DOM parser
* Natural Language Processing: part-of-speech taggers, n-gram search, sentiment analysis, WordNet
* Machine Learning: vector space model, clustering, classification (KNN, SVM, Perceptron)
* Network Analysis: graph centrality and visualization.
It is well documented, thoroughly tested with 350+ unit tests and comes bundled with 50+ examples. The source code is licensed under BSD.

Example
-------
This example trains a classifier on adjectives mined from Twitter using Python 3. First, tweets that contain hashtag #win or #fail are collected. For example: *"$20 tip off a sweet little old lady today #win"*. The word part-of-speech tags are then parsed, keeping only adjectives. Each tweet is transformed to a vector, a dictionary of adjective → count items, labeled `WIN` or `FAIL`. The classifier uses the vectors to learn which other tweets look more like `WIN` or more like `FAIL`.
```python
from pattern.web import Twitter
from pattern.en import tag
from pattern.vector import KNN, count
twitter, knn = Twitter(), KNN()
for i in range(1, 3):
for tweet in twitter.search('#win OR #fail', start=i, count=100):
s = tweet.text.lower()
p = '#win' in s and 'WIN' or 'FAIL'
v = tag(s)
v = [word for word, pos in v if pos == 'JJ'] # JJ = adjective
v = count(v) # {'sweet': 1}
if v:
knn.train(v, type=p)
print(knn.classify('sweet potato burger'))
print(knn.classify('stupid autocorrect'))
```
Installation
------------
Pattern supports Python 2.7 and Python 3.6. To install Pattern so that it is available in all your scripts, unzip the download and from the command line do:
```bash
cd pattern-3.6
python setup.py install
```
If you have pip, you can automatically download and install from the [PyPI repository](https://pypi.python.org/pypi/pattern):
```bash
pip install pattern
```
If none of the above works, you can make Python aware of the module in three ways:
- Put the pattern folder in the same folder as your script.
- Put the pattern folder in the standard location for modules so it is available to all scripts:
* `c:\python36\Lib\site-packages\` (Windows),
* `/Library/Python/3.6/site-packages/` (Mac OS X),
* `/usr/lib/python3.6/site-packages/` (Unix).
- Add the location of the module to `sys.path` in your script, before importing it:
```python
MODULE = '/users/tom/desktop/pattern'
import sys; if MODULE not in sys.path: sys.path.append(MODULE)
from pattern.en import parsetree
```
Documentation
-------------
For documentation and examples see the [user documentation](https://github.com/clips/pattern/wiki).
Version
-------
3.6
License
-------
**BSD**, see `LICENSE.txt` for further details.
Reference
---------
De Smedt, T., Daelemans, W. (2012). Pattern for Python. *Journal of Machine Learning Research, 13*, 2031–2035.
Contribute
----------
The source code is hosted on GitHub and contributions or donations are welcomed.
Bundled dependencies
--------------------
Pattern is bundled with the following data sets, algorithms and Python packages:
- **Brill tagger**, Eric Brill
- **Brill tagger for Dutch**, Jeroen Geertzen
- **Brill tagger for German**, Gerold Schneider & Martin Volk
- **Brill tagger for Spanish**, trained on Wikicorpus (Samuel Reese & Gemma Boleda et al.)
- **Brill tagger for French**, trained on Lefff (Benoît Sagot & Lionel Clément et al.)
- **Brill tagger for Italian**, mined from Wiktionary
- **English pluralization**, Damian Conway
- **Spanish verb inflection**, Fred Jehle
- **French verb inflection**, Bob Salita
- **Graph JavaScript framework**, Aslak Hellesoy & Dave Hoover
- **LIBSVM**, Chih-Chung Chang & Chih-Jen Lin
- **LIBLINEAR**, Rong-En Fan et al.
- **NetworkX centrality**, Aric Hagberg, Dan Schult & Pieter Swart
- **spelling corrector**, Peter Norvig
Acknowledgements
----------------
**Authors:**
- Tom De Smedt (tom@organisms.be)
- Walter Daelemans (walter.daelemans@ua.ac.be)
**Contributors (chronological):**
- Frederik De Bleser
- Jason Wiener
- Daniel Friesen
- Jeroen Geertzen
- Thomas Crombez
- Ken Williams
- Peteris Erins
- Rajesh Nair
- F. De Smedt
- Radim Řehůřek
- Tom Loredo
- John DeBovis
- Thomas Sileo
- Gerold Schneider
- Martin Volk
- Samuel Joseph
- Shubhanshu Mishra
- Robert Elwell
- Fred Jehle
- Antoine Mazières + fabelier.org
- Rémi de Zoeten + closealert.nl
- Kenneth Koch
- Jens Grivolla
- Fabio Marfia
- Steven Loria
- Colin Molter + tevizz.com
- Peter Bull
- Maurizio Sambati
- Dan Fu
- Salvatore Di Dio
- Vincent Van Asch
- Frederik Elwert
================================================
FILE: __init__.py
================================================
================================================
FILE: docs/clips.css
================================================
/* --- GENERAL STYLES ------------------------------------------------------------------------------------------- */
@import url(http://fonts.googleapis.com/css?family=Roboto+Slab:300,700);
@import url(http://fonts.googleapis.com/css?family=Inconsolata:400,700);
body { margin: 0; padding: 0; background: rgb(128,128,128) url(g/gradient.jpg); background-repeat: repeat-x; }
body, table, th, td, fieldset, legend,
fieldset.group-info,
fieldset.group-info .field-item a,
.page-demos #content caption h3 {
color: #444; font: normal 9pt "Roboto Slab", Georgia, Times, serif;
}
/* Ignore copy & pasted font styles. */
.node span[style] {
font: inherit !important;
}
sup { color: #666; }
table { margin: 1em 0; }
tr, tr.even, tr.odd { background: none; }
td { padding: 0.2em 1em 0.2em 0; vertical-align: top; }
h1, table h1 { font-size: 1.7em; }
h2, table h2 { font-size: 1.25em; }
h3, table h3 { font-size: 1.25em; }
h1, h2, h3 { font-weight: normal; }
/* Extra icon indicates clickable titles. */
h1 a, h2 a, h3 a,
.page-projects .views-field-title a,
.page-software .views-field-title a,
.page-datasets .views-field-title a,
.page-demos .views-field-title a,
.page-computational-linguistics .views-field-title a,
.page-language-acquisition .views-field-title a,
.page-language-processing .views-field-title a,
.section-software .views-field-title a,
.section-ctrs .views-field-title a,
.section-internal-pages h2.title a,
.view-resources-block .views-field-title a {
padding-right: 12px;
background-image: url(g/more.png);
background-position: right !important;
background-repeat: no-repeat;
color: #444;
text-decoration: none;
}
h1 a:hover, h2 a:hover, h3 a:hover,
.views-field-title a:hover { color: #444; text-decoration: underline; }
.page-projects .views-field-title a,
.page-software .views-field-title a,
.page-datasets .views-field-title a,
.page-demos .views-field-title a,
.page-computational-linguistics .views-field-title a,
.page-language-acquisition .views-field-title a,
.page-language-processing .views-field-title a,
.section-software .views-field-title a,
.section-ctrs .views-field-title a,
.view-resources-block .views-field-title a { font-size: 1.3em; }
.view-resources-block .views-field-title { margin: 1em 0 1em 0; }
h1.title, h2.title, h3.title { margin: 0; }
h1 { margin-bottom: 1em !important; }
a { color: rgb(20,120,240); }
a { outline: none !important; }
/* Extra icon indicates external links. */
a[href^="http"] {
padding-right: 12px;
background-image: url(g/external.png);
background-position: right !important;
background-repeat: no-repeat;
}
a.noexternal { background-image: none; padding-right: 0; }
a.link-news[href^="http"] {
background-image: url(g/external-news.png);
}
p { margin: 0.2em 0 0.6em 0; }
.field-label {
margin-bottom: 0.5em;
border-bottom: 1px solid #ccc;
font-size: 1.1em;
font-variant: small-caps;
font-weight: normal !important;
}
.block { margin-bottom: 1em !important; }
.block ul, .item-list ul { margin: 0.5em 0 0 0 !important; padding: 0 0 0 1.5em; }
li { line-height: 1.5em; }
ul ul li { list-style-type: disc; }
hr { height: 0px !important; border: 0; border-top: 1px solid #ccc; }
textarea { }
div.resizable-textarea .grippie { display: none; }
/* Hide title on front page. */
.front h1.title { display: none; }
/* CSS for Twitter/FB/G+/LinkedIn share buttons */
.social-button-container {
margin-top: 2em;
overflow: visible;
}
.social-button {
float: left;
width: 100px;
height: 20px;
}
/* --- PAGINATION ---------------------------------------------------------------------------------------------- */
.pager { }
.pager li { padding: 0.1em 0.4em 0.2em 0.4em !important; }
.pager a { padding: 0 !important; color: rgb(20,120,240) !important; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager-current {
background: #0b5083;
color: white;
font-weight: normal;
border-radius: 0.3em;
-moz-border-radius: 0.3em;
-webkit-border-radius: 0.3em; }
/* --- SEARCH -------------------------------------------------------------------------------------------------- */
/* Search results page. */
.section-search #content h1,
.section-search-pages #content h1 { margin-bottom: 0.5em !important; }
.section-search .box,
.section-search-pages .box { background: none !important; border: 0 !important; padding: 0; }
.section-search #content h2,
.section-search-pages #content h2 { border-top: 1px solid #ccc; margin-top: 2em; display: none; }
.section-search #content-header .tabs,
.section-search-pages #content-header .tabs { margin-bottom: 2em; }
.section-search #search-form,
.section-search-pages #content #search { margin-top: -6.5em; float: right; }
.section-search .form-text,
.section-search-pages .form-text { width: 200px; }
.section-search #search-form .search-advanced,
.section-search-pages #search-form .search-advanced { display: none; }
.section-search dt,
.section-search-pages dt { margin: 0; padding-bottom: 0.1em; font-size: 1.2em; }
.section-search dd,
.section-search-pages dd { margin: 0 0 1.5em 0; margin-top: 0.1em; }
.section-search .search-snippet,
.section-search-pages .search-snippet { margin-bottom: 0; }
.section-search .search-info,
.section-search .search-info a,
.section-search-pages .search-info,
.section-search-pages .search-info a { color: #888; font-size: 0.95em; }
.section-search a[href^="http"],
.section-search-pages a[href^="http"] { background: none; }
.section-search-pages #sidebar-left { }
.section-search #sidebar-right li a { color: rgb(140,170,255); }
/* --- CONTENT FLAT PAGES --------------------------------------------------------------------------------------- */
/* Flat pages generated with the Page content type (e.g. Home). */
body.node-type-page div.tabs { }
body.node-type-page .meta { margin-top: -1.5em; margin-bottom: 1.5em; }
/* --- CONTENT TAGS (TAXONOMY TERMS) ---------------------------------------------------------------------------- */
/* Keywords such as "stylometry" attached to publictations, talks, software, etc. */
/* The color changes to match the background color of a publication or talk. */
.terms li { margin-bottom: 2.5em !important; }
.terms li,
.view-publications .views-field-tid,
.view-talks .views-field-tid,
.page-computational-linguistics .views-field-name a,
.page-language-acquisition .views-field-name a,
.page-language-processing .views-field-name a,
.page-projects .views-field-name a,
.page-software .views-field-tid a,
.page-datasets .views-field-tid a,
.page-demos .views-field-tid,
.biblio-entry .taxonomy-terms {
margin-right: 0.3em;
font-variant: small-caps;
font-size: 1.2em;
font-weight: bold;
font-style: normal;
text-transform: lowercase;
}
.terms li a,
.page-computational-linguistics .views-field-name a,
.page-language-acquisition .views-field-name a,
.page-language-processing .views-field-name a,
.page-projects .views-field-name a,
.page-software .views-field-tid a,
.page-datasets .views-field-tid a,
.page-demos .views-field-tid a,
.biblio-entry .taxonomy-terms {
color: #0e5682; text-decoration: none;
}
.view-publications .views-field-tid a,
div.node-type-biblio .terms a,
.biblio-entry .terms a,
.biblio-entry .taxonomy-terms {
color: #701637; text-decoration: none;
}
.view-talks .views-field-tid a,
.section-taxonomy .biblio-talks .terms a,
.section-category .biblio-talks .terms a,
.biblio-talks .terms a,
.biblio-talks .taxonomy-terms {
color: #5b682e !important; text-decoration: none;
}
.terms li a:hover,
.view-publications .views-field-tid a:hover,
.view-talks .views-field-tid a:hover,
.page-computational-linguistics .views-field-name a:hover,
.page-language-acquisition .views-field-name a:hover,
.page-language-processing .views-field-name a:hover,
.page-projects .views-field-name a:hover,
.page-software .views-field-tid a:hover,
.page-datasets .views-field-tid a:hover {
text-decoration: underline;
}
/* --- CONTENT TAGS: LIST (TAXONOMY VIEW) ----------------------------------------------------------------------- */
/* Better alignment in the overview for everything tagged with this keyword. */
/* Publications in this view are colorized with Javascript, see sites/all/themes/clips/script.js
or with PHP (see sites/all/themes/clips/template.php. */
.section-taxonomy h1,
.section-category h1 {
text-transform: capitalize;
}
.section-taxonomy .node,
.section-category .node {
margin-bottom: 1.5em;
}
.section-taxonomy div.node-type-biblio,
.section-category div.node-type-biblio {
margin-bottom: 1em;
}
.section-taxonomy .node h2,
.section-category .node h2 {
border-top: 1px solid #ccc;
padding-top: 0.5em;
margin-bottom: 0;
}
.section-taxonomy div.node-type-biblio h2,
.section-category div.node-type-biblio h2 {
border-top: 0;
padding-top: 0;
display: none;
}
.section-taxonomy div.node-type-biblio .terms,
.section-category div.node-type-biblio .terms {
display: none;
}
.section-taxonomy .node-type-story .content,
.section-category .node-type-story .content {
margin: 0.5em 0 0.5em 0;
}
.section-taxonomy .node-type-software .meta,
.section-category .node-type-software .meta {
display: none;
}
.section-taxonomy .node .field-field-abstracteng .field-label,
.section-category .node .field-field-abstracteng .field-label,
.page-projects .node .field-field-abstracteng .field-label {
display: none;
}
.section-taxonomy .node .field-field-period,
.section-category .node .field-field-period,
.section-taxonomy .node .field-field-sponsor,
.section-category .node .field-field-sponsor,
.section-taxonomy .node .field-field-intro,
.section-category .node .field-field-intro {
display: none;
}
.section-taxonomy .node .field-field-link,
.section-category .node .field-field-link {
background: url(g/download4.gif) no-repeat;
padding-left: 23px;
padding-top: 1px;
padding-bottom: 0;
margin-top: 0.5em;
margin-bottom: 0;
border-bottom: 0;
min-height: 20px;
}
.section-taxonomy .node .terms,
.section-category .node .terms {
display: none;
}
.section-taxonomy .node .form-item,
.section-category .node .form-item {
display: none;
}
.section-taxonomy .node ul.links,
.section-category .node ul.links {
display: none;
}
/* --- RESEARCH GROUPS ------------------------------------------------------------------------------------------- */
.page-computational-linguistics #content .view-header,
.page-language-acquisition #content .view-header,
.page-language-processing #content .view-header {
font-size: 1em;
line-height: 1.6em;
margin-bottom: 3em;
}
.page-computational-linguistics .views-label-field-abstracteng-value,
.page-language-acquisition .views-label-field-abstracteng-value,
.page-language-processing views-label-field-abstracteng-value {
display: none;
}
.page-computational-linguistics .views-field-field-abstracteng-value,
.page-language-acquisition .views-field-field-abstracteng-value,
.page-language-processing views-field-field-abstracteng-value {
margin-top: 0.5em;
}
/* --- CONTENT TYPE: PROJECTS, SOFTWARE, DATASETS ---------------------------------------------------------------- */
.node-type-software h1.title,
.node-type-demo h1.title { margin: 0 !important; }
.page-projects h1,
.page-software h1,
.page-datasets h1 { margin-bottom: 1em; }
.page-projects #content .views-row,
.page-computational-linguistics #content .views-row,
.page-language-acquisition #content .views-row,
.page-language-processing #content .views-row,
.page-projects .node,
.page-software .node,
.page-datasets .node { border-top: 1px solid #ccc; }
/* Make the "Past Projects" header more visible. */
.page-projects h3,
.page-computational-linguistics h3,
.page-language-acquisition h3,
.page-language-processing h3 {
font-size: 1.1em;
font-variant: small-caps;
margin: 2em 0 1.5em 0;
padding: 0.2em 0.2em 0.2em 0.5em;
background: #003a69;
border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em;
color: white;
}
.page-computational-linguistics #content .views-row,
.page-language-acquisition #content .views-row,
.page-language-processing #content .views-row,
.page-projects #content .views-row { padding-top: 0.5em; padding-bottom: 1em; }
.page-computational-linguistics #content .views-row,
.page-language-acquisition #content .views-row,
.page-language-processing #content .views-row,
.page-projects #content .views-row,
.page-software h2,
.page-datasets h2 { margin: 0.5em 0 0 0; }
.page-software .field-type-link,
.page-datasets .field-type-link,
.section-software .field-type-link,
.node-type-software .field-type-link,
.node-type-demo .field-type-link {
background: url(g/download2.gif) no-repeat;
padding-left: 40px;
padding-top: 11px;
min-height: 30px;
}
.page-projects .views-field-field-abstracteng-value { margin-top: 0.5em; }
.page-software .field,
.page-datasets .field { margin-top: 0.5em; }
/* Project member list and screenshots in the sidebar. */
.view-og-members-faces table { margin: 0; }
.view-og-members-faces td { float: left; display: inline; padding: 0 3px 0 0; }
.view-og-members-faces img { border: 1px solid #ccc; }
#block-views-og_members_faces-block_1 h2 { font-size: 0.9em; line-height: 1.2em; margin-bottom: 0.75em; }
#block-views-og_members-block_1 { margin-bottom: 0 !important; }
.views-field-field-others-value div.field-content { display:list-item; list-style-type: disc; margin: 0 0 0 1.5em; }
.views-field-field-others-value div.field-item { display:list-item; list-style-type: disc; margin: 0; }
.views-field-field-others-value div.field-item:first-child { display: inline; }
/* Project software in the sidebar. */
#block-views-project_software-block_1 ul,
#block-views-project_demos-block_1 ul {
margin: 0; padding: 0; list-style-type: none;
}
#block-views-project_software-block_1 li,
#block-views-project_demos-block_1 li {
background: url(g/download3.gif) no-repeat;
padding-left: 30px;
padding-top: 6px;
min-height: 25px;
}
/* Project publications. */
.project-publications { margin-top: 2em; }
/* Project date. */
.date-display-start, .date-display-separator, .date-display-end { font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 1em; }
.section-projects .field-field-subtitle { font-size: 1.0em; font-weight: bold; }
.section-projects #sidebar-left .pager { display: none; }
/* The /og page search form. */
.section-og table.views-table th,
.section-og table.sticky-header th {
font-size: 1.1em;
font-variant: small-caps;
}
.section-og table.views-table th a,
.section-og table.sticky-header th a {
color: #444;
}
.section-og table.views-table th.views-field-name,
.section-og table.views-table td.views-field-name,
.section-og table.views-table th.views-field-subscribe,
.section-og table.views-table td.views-field-subscribe { }
.section-og #content table { width: 100%; }
.section-og #content table caption { text-align: left; font: 1.25em "Roboto Slab", Georgia, Times, serif; margin: 1em 0 0 0; padding-top: 1em; }
.section-og #content th { white-space: nowrap; }
.section-og #content th a { text-decoration: none; }
.section-og #content th,
.section-og #content td { padding: 0.5em 1em 0.5em 0; border-bottom: 1px solid #ddd; }
.section-og #content tr.even td { background: white; }
.section-og #content tr.odd td { background: #f0f5fa; }
.section-og #content td a { color: #333; white-space: nowrap; }
.section-og #content td a:hover { color: black; }
.section-og #content td.views-field-view-node a { }
.section-og #content td.views-field-name { white-space: nowrap; }
.section-og #content td.views-field-name a { }
.section-og #content td.views-field-name a:hover { text-decoration: underline; }
.section-og #content td.views-field-post-count { text-align: center; }
.section-og #content td.views-field-member-count { text-align: center; }
.section-og #content td.views-field-member-count a { color: rgb(20,120,240); }
.section-og #content .view-og-members-faces { margin-top: 2em; }
.section-og #content .view-og-members-faces td { display: block; float: left; width: 100%; border: 0; padding: 0; }
.section-og #content .view-og-members-faces td { text-align: left; }
.section-og #content .view-og-members-faces td div { display: inline; vertical-align: top; }
.section-og #content .view-og-members-faces td div.picture { padding-right: 0.5em; }
.section-og #content .view-og-members-faces .views-field-is-admin { font-style: normal; color: #999; }
.section-og #content .views-field-name { display: none; }
.section-og #content td.views-field-managelinkadmin a,
.section-og #content td.views-field-managelink a { color: rgb(140,170,255) !important; }
.section-og #content .view-filters form div { display: inline; }
.section-og #content .view-filters form label { display: block; margin-bottom: 0.5em; width: 100%; }
.section-og #content form { font-family: Arial; }
.section-og #content form .description { }
fieldset.group-info { border: 0; background: none; padding: 0; margin: 0; }
fieldset.group-info legend { display: none; }
fieldset.group-info a { color: rgb(20,120,240) !important; text-decoration: underline; }
fieldset.group-info p { line-height: 1.6em !important; }
.page-software #content table,
.page-datasets #content table, .section-software #content table { margin-top: 0; }
.page-software #content tr,
.page-datasets #content tr, .section-software #content tr { border: 0; }
.page-software #content td,
.page-datasets #content td, .section-software #content td { display: block; float: left; width: 100%; }
.page-software #content td.views-field-title,
.page-datasets #content td.views-field-title,
.section-software #content td.views-field-title { background: none; padding-top: 0.5em; border-top: 1px solid #ccc; }
.page-software #content td.views-field-field-link-url,
.page-datasets #content td.views-field-path,
.section-software #content td.views-field-field-link-url {
background: url(g/download3.gif) no-repeat;
padding-left: 30px;
padding-top: 6px;
margin-bottom: 1em;
min-height: 25px;
}
.view-resources-block table.views-view-grid td { padding: 0 1.5em 1em 0; }
.view-resources-block table.views-view-grid .views-field-view-node a:after { content: " »"; color: rgb(100,140,190); }
.view-resources-block table.views-view-grid .views-field-view-node a { color: rgb(100,140,190); }
.section-datasets .field-field-corpus-version .field-label,
.section-datasets .field-field-dataset-language .field-label { float: left; border: 0; margin-right: 0.2em; }
.section-datasets .field-field-corpus-version,
.section-datasets .field-field-dataset-language { border-bottom: 1px solid #ccc; }
.section-datasets .field-field-dataset-citation .field-label { margin-bottom: 1em; }
.section-datasets .field-field-license a { background-image: none; }
.section-datasets .field-field-corpus-version .field-items { font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 1em; }
.page-datasets #content th.views-field-path { display: none; }
/* Layout of "Request Dataset" block (Ben 2013-11-22) */
div.request {
text-align: center;
}
a.request {
display: block;
margin: auto;
background: url(g/download5.gif) no-repeat;
width: 115px;
height: 45px;
padding-top: 12px;
text-align: center;
text-decoration: none;
color: white;
font-family: Tahoma, Verdana, Arial, Helvetica, "Bitstream Vera Sans", sans-serif;
font-weight: normal;
}
a.request:hover { text-decoration: underline; }
.page-demos #content table { margin-top: 0; }
.page-demos #content caption { text-align: left; }
.page-demos #content caption h3 { margin: 2em 0 0 0; font-size: 1.1em; font-variant: small-caps; }
.page-demos #content tr { border: 0; }
.page-demos #content td { display: block; float: left; width: 100%; }
.page-demos #content td.views-field-title { background: none; padding-top: 0.5em; border-top: 1px solid #ccc; }
.page-demos #content td.views-field-field-link-url,
.page-public-scripts td.views-field-upload-fid li {
background: url(g/download4.gif) no-repeat;
padding-left: 23px;
padding-top: 1px;
margin-bottom: 1em;
min-height: 20px;
}
.node-type-demo #content .tabs { }
.node-type-demo .field-type-link { border-bottom: 1px solid #ccc; margin-bottom: 0.5em; padding-bottom: 1em; }
.node-type-demo .field-type-link + p { }
.node-type-demo .submitted { display: none; }
.node-type-demo #content .content { }
/* --- CONTENT TYPE: SCRIPTS ------------------------------------------------------------------------------------- */
/* Shared programming scripts repository. */
body .syntaxhighlighter div.toolbar { background-color: transparent !important; }
body .syntaxhighlighter div.toolbar .command_help { display: none !important; }
.node-type-script h1.title { margin-bottom: 0.5em !important; }
.node-type-script .field { border-bottom: 1px solid #ccc; padding-bottom: 0.4em; margin: 0.4em 0; }
.node-type-script .field-label,
.node-type-script .field-items,
.node-type-script .field-item { display: inline; border: 0; }
.node-type-script .field-field-script-version .field-item div { font-size: 1.1em; font-variant: small-caps; font-weight: normal; }
.node-type-script .field-field-script-language .field-item { font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 13px; }
.node-type-script .field-field-script-description {}
.node-type-script .field-field-script-description .field-items { display: inline-block; width: 400px; vertical-align: top; }
.node-type-script .field-field-script-authors { margin-bottom: 1.2em; }
.node-type-script .field-field-script-authors .field-item { display: inline; padding-right: 4px; }
.node-type-script .field-field-script-authors a { }
.node-type-script .submitted { display: none; }
.node-type-script #content table { border-collapse: collapse; }
.node-type-script #content table td { border: 1px solid #ccc; }
.node-type-script #content table#attachments td { border: 0; }
.section-public-scripts h1.title { margin-bottom: 0.5em !important; }
.section-public-scripts table { width: 575px; margin-top: 2em; }
.section-public-scripts th { font-size: 1.1em; font-variant: small-caps; }
.section-public-scripts th { padding: 0.7em; }
.section-public-scripts td { padding: 0.7em; }
.section-public-scripts #content td a:hover { color: rgb(20,120,240) !important; }
.section-public-scripts td.views-field-title { white-space: nowrap; }
.section-public-scripts td.views-field-field-script-version-value {
text-align: center;
}
.section-public-scripts td.views-field-field-script-language-value {
text-align: center;
font-family: "Inconsolata", "Courier New", Courier, monospace;
font-size: 13px;
}
.section-public-scripts td { font-size: 0.95em; }
.section-public-scripts td.views-field-upload-fid ul { padding: 0 !important; margin: 0 !important; }
.section-public-scripts td.views-field-upload-fid li {
list-style: none; margin: 0;
}
.section-public-scripts table#tutorials { border-bottom: 1px solid #ccc; margin-top: 1em; }
.section-public-scripts table#tutorials td:first-child { width: 10%; white-space: nowrap; }
.section-public-scripts table#tutorials td { }
.section-public-scripts table#tutorials td ul { margin-top: 0; }
/* --- CONTENT TYPE: STORIES, STORY NEWS ------------------------------------------------------------------------- */
/* Global stories, either as news item teaser or as full pages. */
.node .links li, .comment .links li { margin-right: 0.2em; }
.node-type-story .content { margin: 0.5em 0 0.5em 0; }
.node-type-story h1.title { margin-bottom: 0 !important; }
.node-type-story div.meta { margin-bottom: 1em; }
.view-news-items h3#NewsPostDetailTitle { display: none; }
.view-news-items .views-row-odd { }
.view-news-items .node { margin-top: 1.5em; padding-top: 0.5em; border-top: 1px solid #ccc; }
.view-news-items .node .content { color: #555; }
.view-news-items .node-type-story .content a { color: rgb(100,140,190); background-image: none; padding-right: 0; }
.view-news-items .node-type-story .content p,
.view-news-items .node-type-story .content div { margin-bottom: 0em; display: inline; margin-right: 0.1em; }
.view-news-items .content br { content: " "; }
.view-news-items .content br:after { content: " "; }
.view-news-items .node-type-story .content img,
.view-news-items .node-type-story .content iframe {
margin: 0.5em 0 0.5em 0 !important;
display: block !important;
float: none !important;
width: 100%;
height: auto;
}
.view-news-items .node-type-story .content iframe {
height: 300px;
}
.view-news-items .node-type-story .node_read_more:after { content: " »"; color: rgb(0,100,255); }
.view-news-items .pager { margin-top: 2em !important; }
/* Date reference: "Submitted by X on Y in Z." */
.submitted a { color: #888; }
.submitted, .node .terms-inline { display: inline; color: #888; font-size: 0.95em; }
/* --- CONTENT TYPE: TWEETS & NEWS ITEMS ------------------------------------------------------------------------ */
/* Twitter updates and project news displayed in the left sidebar. */
.view-tweets { margin: 0.5em 0 1em 0; }
.view-tweets ul,
.view-project-news ul,
#sidebar-left .view-news-items ul { margin: 0; padding: 0; list-style-type: none; }
.view-tweets li,
.view-project-news li,
#sidebar-left .view-news-items li,
#sidebar-right .view-internal-pages li {
margin-bottom: 0.5em !important;
padding: 0.5em !important;
background: #e9eee0;
border: 1px solid #d0d1c7;
border-radius: 0.4em; -moz-border-radius: 0.4em; -webkit-border-radius: 0.4em;
font-size: 0.9em;
line-height: 1.5em;
}
#sidebar-right .view-internal-pages .pager li { border: 0; background: none; color: orange; }
#sidebar-right .view-internal-pages .pager li a { color: orange !important; }
.view-tweets a { background: none; color: orange; }
.view-tweets p { margin: 0; }
.view-tweets em { }
.view-tweets .views-field-created-time { font-style: italic; }
.view-project-news li div { display: inline; }
.view-project-news li a { color: orange; }
#sidebar-left .view-news-items .views-field-title,
#sidebar-left .view-news-items .views-field-view-node { display: inline !important; }
#sidebar-left .view-news-items .views-field-view-node a { color: black; }
#sidebar-left .view-news-items .more-link a { color: orange; text-transform: capitalize; text-align: left; }
#sidebar-right .view-internal-pages ul { margin: 0; padding: 0; list-style-type: none; }
#sidebar-right .view-internal-pages a { color: black; }
#sidebar-right .view-internal-pages .more-link a { color: orange; text-transform: capitalize; text-align: left; }
/* Hide external link image for social links */
#sidebar-right #social-links { text-align: center; }
#sidebar-right #social-links a { background-image: none; padding: 0 2px 0 0; }
#sidebar-right #social-links img { width: 25px; height: 25px; }
/* --- CONTENT TYPE: PUBLICATION -------------------------------------------------------------------------------- */
/* Citations appear in a purple box with rounded corners. */
.view-publications .search-link,
.view-talks .search-link {
float: right;
}
.view-publications .views-row,
.view-talks .views-row,
div.node-type-biblio,
.biblio-entry,
.section-datasets .field-field-dataset-citation p {
margin-bottom: 1em;
padding: 0.7em;
background: #e5e3ef;
border: 1px solid #cdcbd6;
border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em;
}
.view-publications .biblio-entry { margin: 0; padding: 0; background: none; border: 0; }
/* Text styling of a citation, across projects, persons, etc. */
.bilbio-entry { }
.biblio-entry h2, div.node-type-biblio h2 { margin: 0 !important; }
.biblio-authors a { color: #444; text-decoration: underline; }
.biblio-authors a:hover { color: #222; text-decoration: underline; }
.biblio-title a,
.biblio-title-vancouver a { color: #444; font: bold 1em "Roboto Slab", Georgia, Times, Serif; text-decoration: none; }
.biblio-title a:hover { text-decoration: underline; }
.biblio-entry u, div.node-type-biblio u { font-style: normal; text-decoration: none; }
.biblio-separator-bar { padding: 0; background: none; border: 0; color: #444; font: normal 1.3em "Roboto Slab", Georgia, Times, serif; }
td.biblio-row-title { font-size: 1.1em; font-variant: small-caps; white-space: nowrap; }
.biblio_authors a { color: #444; text-decoration: none; } /* Editors */
.section-datasets .field-field-dataset-citation p a { color: #444; text-decoration: none; font-weight: bold; font-style: normal; }
.section-datasets .field-field-dataset-citation p a:hover { text-decoration: underline; }
/* Biblio search and filter options. */
.page-biblio .breadcrumb { margin: 0 !important; }
.section-biblio h1.title { margin-bottom: 0.5em !important; }
.section-biblio .tabs { }
#biblio-search-form .biblio-search { margin-bottom: 0.5em; }
.biblio-export-buttons { margin: 0; font-size: 0.75em; text-transform: uppercase; font-weight: bold; display: inline; }
.biblio-export-buttons li { margin: 0; }
.biblio-export-buttons .comment_add,
.biblio-export-buttons .upload_attachments { display: none; }
.biblio-export-buttons a:hover { color: #000; }
.biblio-export a, .biblio-export-buttons a { }
.biblio-export a,
.biblio-export-buttons a,
.biblio_tagged a,
.biblio_xml a,
.biblio_bibtex a,
.biblio_google_scholar a { margin: 0 0.1em 0 0; background: 0; color: #444; }
.biblio-abstract-link { display: none; }
#biblio-header { margin-top: -3em; }
#biblio-header form { margin-bottom: 3em; padding-top: 0.2em; }
#biblio-header form input.form-text { width: 200px; }
#biblio-header { height: 2.5em; overflow: hidden; }
#biblio-header { text-align: right; }
#biblio-header .biblio-export { display: none; }
#biblio-header .biblio-export { text-align: left; float: none; margin-bottom: 0.5em; }
#biblio-header .biblio-export-buttons { display: inline; }
#biblio-header > a { text-transform: none; color: #444; font-size: 1.1em; font-variant: small-caps; text-decoration: none; }
#biblio-header > a:hover { text-decoration: underline; }
#biblio-header a,
.biblio-alpha-line { margin-left: 0.3em; }
.biblio-alpha-line { margin: 0.4em; }
.biblio-alpha-line a { text-decoration: none; }
.biblio-alpha-line a:hover { text-decoration: underline; }
.biblio-alpha-line b { color: #003a68; }
.biblio-current-filters { background: none; color: #888; text-align: right; font-size: 0.95em; margin-bottom: -1em; }
.biblio-current-filters a { text-transform: none; color: #888; }
.biblio-current-filters, .biblio-current-filters * {
font-weight: normal;
font-style: normal;
}
.section-bibliography h1 { margin-bottom: 0 !important; }
.section-bibliography div.node-type-biblio {
background: none !important;
border: 0 !important;
padding: 0;
}
.section-bibliography div.node-type-biblio .content {
margin-top: 2em;
}
.section-bibliography div.node-type-biblio .terms a {
color: #0e5682 !important;
}
/* Download attachment */
#attachments th { font-size: 1.1em; font-variant: small-caps; border-bottom: 1px solid #ccc; padding-right: 0.5em; white-space: nowrap; }
#attachments th:last-child { width: 100%; }
#attachments td { }
#attachments td:first-child a { white-space: nowrap; }
#attachments tr { border-bottom: 0; }
#attachments { }
.section-user fieldset {
background: #f4f4f4;
font: normal 13px "Lucida","Lucida Grande","Trebuchet MS",Tahoma,Verdana,sans-serif;
}
.section-user fieldset * {
font-variant: normal !important;
}
/* PDF download button in publications. */
.biblio_file_links {
display: block;
text-align: right;
position: relative; right: -30px;
margin-top: -1.2em;
margin-bottom: -0.1em;
}
.biblio_file_links a,
#attachments td:first-child a {
margin: 0 0.2em 0 0.2em;
padding: 0.3em 0.4em 0.3em 0.4em;
background-image: url(g/shadow-label.png);
background-repeat: repeat-x;
background-color: #6d678a;
color: white;
font: normal 0.8em Arial;
text-transform: uppercase;
text-decoration: none;
border-radius: 0.4em; -moz-border-radius: 0.4em; -webkit-border-radius: 0.4em;
}
.biblio_file_links a:hover,
#attachments td:first-child a:hover {
text-decoration: underline;
}
.biblio-talks .biblio_file_links a {
background-color: #5b682e;
}
#attachments td { padding-top: 0.5em; }
#attachments td:first-child a {
background-color: rgb(20,120,240);
}
.node-type-biblio #page .biblio_file_links {
display: none;
}
/* --- CONTENT-TYPE: TALK --------------------------------------------------------------------------------------- */
/* Talks appear in a green box with rounded corners. */
.view-talks .views-row,
.section-taxonomy .biblio-talks,
.section-category .biblio-talks,
.biblio-talks,
.node-type-project .talks,
.section-user .talks {
background: #e5f8e3 !important;
border: 1px solid #cedecc !important;
}
.view-talks .biblio-entry { margin: 0; padding: 0; background: none; border: 0 !important; }
.field { margin-top: 1em; }
/* --- CONTENT-TYPE: PEOPLE ------------------------------------------------------------------------------------- */
/* List of people, and people pages. */
.page-people h1 { margin-bottom: 0 !important; }
.view-user-page h2 { padding: 1em 0 0 0; border-top: 1px solid #ccc; }
.view-user-page table caption {
width: 100%;
font-family: "Roboto Slab", Georgia, Times, serif;
text-align: left;
}
.view-user-page caption { font-size: 1.3em; margin: 0.5em 0 0.5em 0; padding-top: 0.5em;
padding-left: 55px; margin-left: 1em; }
.view-user-page table { width: 100%; margin-bottom: 2em; }
.view-user-page tr { border-bottom: 0; }
.view-user-page td { padding: 0.5em 0 0 0; border-top: 1px solid #ccc; }
.view-user-page td a:first-child:hover { text-decoration: underline; }
.view-user-page td a:first-child {
padding-right: 12px;
background-image: url(g/more.png);
background-position: right !important;
background-repeat: no-repeat;
color: #444;
font-size: 1.1em;
text-decoration: none;
}
.view-user-page .picture { margin: -1px 0 0 0 !important; }
.view-user-page .picture a { background: none !important; padding: 0; }
.view-user-page .picture img { width: 55px; height: 80px; border: 1px solid #ccc; }
.view-user-page td.views-field-picture { width: 55px; padding: 0 1em 0.7em 0; border-top: 0 !important; }
.profile .picture { float: left; }
.profile .picture img { width: 140px; height: 190px; border: 1px solid #ccc; }
.profile h3 { border: 0; }
.profile dt { font-size: 1.1em; font-weight: normal; font-variant: small-caps; margin: 0; }
.profile dt { width: 100px; float: left; }
.profile dd { width: 400px; border-bottom: 1px solid #ccc; }
.profile dt, .profile dd { margin: 0; padding: 0.2em 0 0.2em 0; }
.profile dl, .profile h3 { margin-left: 160px; }
.profile dt.profile-profile_interests { border-bottom: 1px solid #ccc; width: 400px; float: none; }
.profile dd.profile-profile_interests { border: 0; }
.profile dt.logins { float: none; width: 400px; border-bottom: 1px solid #ccc; }
.profile dd.logins { font-size: 0.9em; line-height: 1.3em; border: 0; color: #666; }
.profile dd.logins a { color: rgb(140,170,255); }
/* Projects (i.e. organic groups) this user belongs to. */
.profile dl.user-member { display: none; }
.section-people #content-bottom .block { margin-left: 160px; }
.section-people #content-bottom #block-views-og_user-block_1 h2 { display: none; }
.biblio-entry .taxonomy-terms { display: none; }
.section-biblio .biblio-entry .taxonomy-terms,
.section-user .biblio-entry .taxonomy-terms { display: block; }
/* --- CONTENT TYPE: TECHNICAL REPORT ---------------------------------------------------------------------------- */
.section-ctrs .views-field-title { margin-bottom: 1em; }
.section-ctrs #content label,
.node-type-ctrs #content .field-label-inline-first {
display: block;
margin: 0.5em 0 0.2em 0;
font-size: 1.1em;
font-variant: small-caps;
font-weight: normal;
border-bottom: 1px solid #ccc;
}
.node-type-ctrs .field-label-inline { display: none !important; }
.section-ctrs .date-display-single,
.node-type-ctrs .date-display-single { font-family: "Inconsolata", "Courier New", Courier, monospace; }
.section-ctrs #content { }
.section-ctrs .image { margin-right: 1em; }
.section-ctrs .image,
.node-type-ctrs .image { border: 1px solid #ccc; float: left; }
.node-type-ctrs .image { margin-top: 2em; }
.image-preview { border: 1px solid #ccc; }
.image_size_larger { display: none !important; }
.image-attach-body { float: left; }
/* --- ARCHIVE OF CORPORA ON THE CLIPS SERVERS ------------------------------------------------------------------ */
.section-corpora-overview table { width: 100%; }
.section-corpora-overview th { font-size: 1.1em; font-variant: small-caps; padding-bottom: 0.5em; }
.section-corpora-overview th a { color: #333; }
.section-corpora-overview tr.odd { background: #F0F5FA; }
.section-corpora-overview td { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 5px 0 5px 0; }
.section-corpora-overview td.active { background: none; }
.section-corpora-overview .views-field-field-corpus-version-value { text-align: center; }
.section-corpora-overview td.views-field-field-corpus-path-value { font-family: "Inconsolata", "Courier New", Courier, monospace; }
.field-field-corpus-path .field-items { font-family: "Inconsolata", "Courier New", Courier, monospace; }
/* --- ARCHIVE OF PUBLICATIONS ---------------------------------------------------------------------------------- */
.page-archive #content-bottom h2 { margin-top: 2em; }
.page-archive #archive .timeline-event-label {
font-size: 0.9em;
font-family: Arial;
font-weight: bold;
padding: 0.1em 0.0em 0.1em 0.3em;
margin: 0em;
background: #e5e3ef;
border: 1px solid #cdcbd6; }
.page-archive #archive .timeline-event-label:hover { text-decoration: underline; }
.page-archive #archive .timeline-event-icon img { display: none; }
.page-archive #archive .timeline-copyright { display: none; }
.page-archive #archive .timeline-date-label { color: #888; }
.page-archive caption { font-size: 1.25em; font-family: "Roboto Slab", Georgia, Times, serif; text-align: left; }
.page-archive .views-table th { padding-top: 0.4em; padding-bottom: 0.8em; font-size: 1.1em; font-variant: small-caps; white-space: nowrap; }
.page-archive .views-table th a { color: #333; }
.page-archive .views-table th,
.page-archive .views-table td { padding: 0.4em 0.8em 0.8em 0; }
.page-archive .views-table td.views-field-title { min-width: 300px; }
.page-archive .views-table td a:hover { color: rgb(20,120,240); }
.page-archive .views-field-upload-fid a {
margin: 0 0.2em 0 0.2em;
padding: 0.1em 0.3em 0.1em 0.3em;
background: #6d678a url(g/shadow-label.png) repeat-x left bottom;
color: white;
font: normal 0.9em Arial;
font-variant: small-caps;
text-decoration: none;
border-radius: 0.4em; -moz-border-radius: 0.4em; -webkit-border-radius: 0.4em;
}
.page-archive .views-field-upload-fid a:hover { text-decoration: underline; color: white !important; }
.page-archive .simileAjax-bubble-container .views-field-field-archive-series-value { display: block; }
.page-archive .simileAjax-bubble-container .views-field-title { display: none; }
.page-archive .simileAjax-bubble-container label { font-size: 1.1em; font-variant: small-caps; font-size: 0.95em; }
.page-archive .simileAjax-bubble-container .timeline-event-bubble-title a {
color: #333;
background: none;
text-decoration: none;
}
.node-type-archive .meta { display: none; }
.node-type-archive .field-label-inline-first { display: block; font-size: 1.1em; font-variant: small-caps; font-weight: normal;
border-bottom: 1px solid #ccc; }
/* --- CONTACT FORM --------------------------------------------------------------------------------------------- */
.page-contact .address { font-size: 1.2em; }
.page-contact .art { color: #888; padding-bottom: 0.5em; display: block; }
.page-contact .art:hover { color: #555; }
/* --- PAGE ----------------------------------------------------------------------------------------------------- */
#page {
width: 1000px;
background: url(g/shadow.png) repeat-y;
font-size: 1em;
}
#page-inner {
width: 960px;
margin-left: 20px;
background: white;
border-left: 1px solid #555;
border-right: 1px solid #555;
}
#page, table, td p {
line-height: 1.6em;
}
/* --- PAGE HEADER ---------------------------------------------------------------------------------------------- */
#header { height: 200px; background: #c0c8d5 url(g/header.jpg) repeat-x; }
#header-inner { background: url(g/scanner.jpg) no-repeat right top; }
#logo { margin: 110px 0 0 85px; padding: 0; }
#logo-image {}
#site-name, div#site-name { display: none; }
/* --- PAGE NAVIGATION ------------------------------------------------------------------------------------------ */
#navbar { height: auto; background: #e6edf1; border-bottom: 1px solid #c6d4dd; }
#navbar-inner {}
#skip-to-nav { display: none; }
.block-search,
.block-search_by_page { position: relative; top: -25px; left: 760px; z-index: 0; width: 200px; }
.block-search input[type="text"],
.block-search_by_page input[type="text"] { width: 110px; }
.block-search h2,
.block-search_by_page h2,
#block-menu-primary-links { display: none; }
.block-search #search-box { } /* Wrapper for the search form */
.block-search #edit-search-block-form-1-wrapper label { display: none !important; }
.block-search #edit-submit,
.block-search #edit-submit-1,
.block-search #edit-submit-2 {
border: 0;
background: #586073 url(g/shadow-label.png) repeat-x left bottom;
color: white;
border-radius: 3px;
padding: 3px 5px 3px 5px;
}
.block-search #edit-submit:hover,
.block-search #edit-submit-1:hover,
.block-search #edit-submit-2:hover {
cursor: pointer;
}
#primary {
height: 50px;
overflow: hidden;
margin: 0;
padding-left: 70px;
background: url(g/UA.jpg) no-repeat;
}
#primary li {
height: 50px;
padding: 0 15px 0 15px;
padding-top: 16px;
background: #dbe6ec;
border-left: 1px solid #c6d4dd;
font-size: 1.25em;
}
#primary li:hover { background: #d1dfe7; }
#primary li.active { background: #0b5083 url(g/current.jpg) repeat-x; box-shadow: inset 0px 0px 3px 3px rgba(0,0,0,0.25); }
#primary li.active a { color: white !important; }
#primary li a { color: #0e5682; text-decoration: none; }
#primary li a:hover { text-decoration: underline; }
#primary li.last a { color: #2a323f; }
#primary li.last { border-right: 1px solid #c6d4dd; }
/* Secondary links */
#secondary {}
/* Publication subnavigation */
#navbar .block { border-top: 1px solid #c6d4dd; margin: 0; }
#navbar .block ul { margin: 0 !important; }
#navbar .block li:first-child { border-left: 1px solid #c6d4dd; }
#navbar #block-block-3 ul { margin-left: 515px !important; }
#navbar #block-block-8 ul { margin-left: 400px !important; }
#navbar .block li { list-style: none; padding: 3px; border-right: 1px solid #c6d4dd; }
#navbar .block li:hover { background: #dbe6ec; }
#navbar .block li a { color: #0e5682; font-size: 0.95em; text-decoration: none; padding: 0 10px 0 10px; }
#navbar .block li a:hover { text-decoration: underline; }
/* --- PAGE SIDEBARS -------------------------------------------------------------------------------------------- */
#sidebar-left {
width: 160px;
margin-left: 30px;
margin-right: -190px !important;
margin-top: 105px !important;
}
#sidebar-left-inner { margin: 0; }
#sidebar-right {
width: 160px;
margin-left: 770px;
margin-right: -160px;
margin-top: 105px !important;
}
#sidebar-right-inner { margin: 0; }
#sidebar-right .block-user h2 { display:none; }
/* Internal "Create content" links */
#block-menu-secondary-links { margin-top: 1.6em; }
#block-menu-secondary-links h2 { font-size: 1.1em; }
#block-menu-secondary-links a { color: rgb(140,170,255); }
#block-menu-secondary-links ul.menu { }
#block-menu-secondary-links li.leaf { list-style: disc !important; }
.section-internal-pages .node-type-script .field { padding: 0 0 0.25em 0; border-bottom: 1px solid #ddd; }
.section-internal-pages h2 {
margin-top: 1.5em;
padding-top: 0.5em;
border-top: 1px solid #ccc;
font-size: 1.25em !important;
}
/* --- PAGE CONTENT --------------------------------------------------------------------------------------------- */
#main {}
#main-inner {}
.one-sidebar #content,
.two-sidebars #content,
#content {
width: 610px !important;
margin-left: 190px !important;
margin-right: -800px !important;
min-height: 450px;
}
.no-sidebars #content,
.sidebar-right #content,
.section-search-pages #content {
width: 610px !important;
margin-left: 65px !important;
margin-right: -800px !important;
}
#content-inner { padding: 50px 70px 105px 20px; }
#content-top {} /* Wrapper for any blocks placed in the "content top" region */
#content-header {} /* Wrapper for breadcrumb, title, messages, tabs, and help */
#content-area {} /* Wrapper for the actual page content */
#content-bottom {} /* Wrapper for any blocks placed in the "content bottom" region */
.breadcrumb { padding-bottom: 0; color: #888; font-size: 11px; }
.breadcrumb a { color: #888; }
div.messages { margin: 1em 0 1em 0;}
div.status {}
div.warning, tr.warning {}
div.error, tr.error {}
div.tabs {}
.help { margin: 1em 0; }
.more-help-link { font-size: 0.85em; text-align: right; }
/* Links */
ul.links { margin: 1em 0; padding: 0; }
ul.links.inline { margin: 0; display: inline; }
ul.links li { display: inline; list-style-type: none; padding: 0; }
/* A list of page numbers when more than 1 page of content is available */
.pager { clear: both; margin: 1em 0; text-align: center; }
.pager a, .pager strong.pager-current { padding: 0.5em; }
/* The links to the RSS or Atom feeds for the current list of content */
.feed-icons { margin: 1em 0; }
/* --- PAGE FOOTER ---------------------------------------------------------------------------------------------- */
#footer { margin-top: 50px; background: #1e272f url(g/footer.jpg) repeat-x; margin-bottom: -10px; }
#footer-inner { padding-top: 20px; }
#footer-inner table {
width: 95%;
margin: 0 30px 0 30px;
min-height: 200px;
color: #80888f;
font-size: 11px;
}
#footer-inner td { color: #80888f; font-size: 9pt; }
#footer-inner td h2 { font-size: 1.1em; font-variant: small-caps; line-height: 1em; margin-bottom: 0 !important; }
#footer-inner td a { color: #80888f; }
#footer-inner #block-block-2 {
min-height: 200px;
}
#footer-inner #block-views-tracker-block_1 {
box-shadow: inset 0px 4px 5px 0px rgba(0,0,0,0.25);
padding: 6px 30px 2px 30px;
font-size: 10px;
color: #70808f;
}
#footer-inner .content { margin: 0; }
#footer-inner a { background: none; color: #80888f; }
#footer-message {}
#closure-blocks {}
#footer-shadow {
margin-left:auto;
margin-right:auto;
width: 1000px;
height: 0px;
background: url(g/shadow-foot.png) 0 0 no-repeat;
}
/* --- DRUPAL FORMS --------------------------------------------------------------------------------------------- */
.form-item,
.form-checkboxes,
.form-radios { margin: 1em 0; }
.form-item input.error,
.form-item textarea.error,
.form-item select { margin-left: 0; }
.form-item select.error { border: 2px solid #c00; }
.form-item label { display: block; font-size: 1.1em; font-variant: small-caps; font-weight: normal; }
.form-item label.option { display: inline; font-weight: normal; }
.form-required { color: deeppink; }
.form-item .description { font-size: 0.85em; }
.form-checkboxes .form-item,
.form-radios .form-item { margin: 0.4em 0; }
.form-submit {}
.container-inline div, .container-inline label { display: inline; }
.tips { margin: 0; padding: 0; font-size: 0.9em; }
/* --- DRUPAL ADMIN TABLES -------------------------------------------------------------------------------------- */
form tbody { border-top: 1px solid #ccc; }
form th { text-align: left; padding-right: 1em; border-bottom: 3px solid #ccc; }
form tbody th { border-bottom: 1px solid #ccc; }
form thead th { text-align: left; padding-right: 1em; border-bottom: 3px solid #ccc; }
/* --- DRUPAL NODES --------------------------------------------------------------------------------------------- */
.comment-unpublished div.unpublished {
height: 0;
overflow: visible;
color: #d8d8d8;
font-size: 75px;
line-height: 1;
font-family: Impact, "Arial Narrow", Helvetica, sans-serif;
font-weight: bold;
text-transform: uppercase;
text-align: center;
word-wrap: break-word;
}
.marker { color: #c00; }
.comment.comment-unpublished .picture { position: relative; }
/* --- DRUPAL COMMENTS ------------------------------------------------------------------------------------------ */
#comments { margin: 2em 0; border-top: 1px solid #ccc; }
.section-comment h1 {
margin-bottom: 1em;
}
.section-comment li.comment_add { display: none; }
.section-comment .box h2 {
margin-top: 2em;
padding-top: 1em;
border-top: 1px solid #ccc;
}
.comment span.new {
padding: 1px 3px 1px 3px;
background: deeppink;
color: white;
font-size: 0.8em;
}
.comment {
margin-bottom: 0.5em; padding: 0.7em;
background: rgb(235,235,255);
border: 1px solid rgb(225,225,255);
border-radius: 0.6em; -moz-border-radius: 0.6em; -webkit-border-radius: 0.6em;
}
.comment div.content { margin: 0.5em 0 0.5em 0; }
.comment ul.links { margin: 1em 0; }
.comment ul.links { margin: 0; text-transform: lowercase; }
.new { color: #c00; }
.comment_add, .node_read_more { text-transform: lowercase; }
#comment-form .tips { display: none; }
#comment-form p { display: none; }
#comment-form fieldset .tips,
#comment-form fieldset p { display: block; }
/* CAPTCHA image security. */
.captcha { padding-bottom: 2em; }
.captcha img { float: left; margin-right: 1em; width: 60px; height: 40px; }
.captcha #edit-captcha-response-wrapper { }
.captcha .description { display: none; }
.wysiwyg-toggle-wrapper a { color: #999; }
/* --- MISCELLANEOUS -------------------------------------------------------------------------------------------- */
.error {}
.warning {}
.more-link { text-align: left; }
#user-login-form { text-align: left; margin: auto; width: 125px; }
#user-login-form .form-item { margin: 0.5em 0 0.5em 0 !important; }
#user-login-form .form-text { width: 110px; }
#user-login-form ul { margin: 0; padding: 0; list-style-type: none; }
#user-login-form ul a { color: rgb(140,170,255); font-size: 0.9em; }
#user-login-form li.openid-link { margin-top: 1em; margin-left: -20px; }
#user-login-form li.user-link { margin-top: 1em; }
#user-login ul { margin: 1em 0; }
#user-login li.openid-link,
#user-login li.user-link { margin-left: -2em; }
.advanced-help-topic { font-family: "Inconsolata", "Courier New", Courier, monospace; }
/* --- ISI Journal List --- */
#node-1501 div.textcell { overflow-y:auto; height: 150px; }
/* --- DRUPAL TABS ---------------------------------------------------------------------------------------------- */
/* Some stuff like tabs and contextual edit menus seeple through to the front-end. */
/* We style them to correspond to pagination and the main navigation. */
div.edit { display: none !important; } /* Hide the old contextual edit menu, use Admin menus. */
div.tabs { }
div.tabs * { background: none !important; padding: 0; margin-bottom: 15px; }
div.tabs li { margin-right: 0.5em; }
div.tabs li * { text-transform: lowercase; padding: 0 !important; }
div.tabs li a { color: rgb(20,120,240) !important; text-decoration: underline; font-weight: normal; }
div.tabs .primary li.active {
padding: 0.1em 0.4em 0.1em 0.4em;
background: #0b5083 !important; box-shadow: inset 0px 0px 3px 3px rgba(0,0,0,0.25) !important;
border-radius: 0.3em; -moz-border-radius: 0.3em; -webkit-border-radius: 0.3em;
}
div.tabs .primary li.active a {
height: auto;
color: white !important;
text-decoration: none;
}
.section-news div.tabs,
.section-projects div.tabs,
.section-software div.tabs,
.section-bibliography div.tabs { }
.section-biblio .breadcrumb { margin-bottom: 1em; }
/* The admin tabs with view/edit/revisions. */
body.node-type-page div.tabs,
.node-type-demo #content .tabs,
.section-biblio .tabs,
.section-news div.tabs,
.section-projects div.tabs,
.section-software div.tabs,
.section-bibliography div.tabs {
font-family: Arial;
font-size: 11px;
}
/* --- ADMIN EDITOR --------------------------------------------------------------------------------------------- */
/* The Edit / Export / Clone links when you hover over a view. */
.views-admin-links .links {
background: #333;
opacity: 0.8;
margin-top: -0.5em !important;
padding: 0.4em !important;
padding-left: 0.7em !important;
border-radius: 0.4em; -moz-border-radius: 0.4em; -webkit-border-radius: 0.4em;
}
.views-admin-links .links * {
font-size: 1em !important;
background: none !important;
padding: 0 0 0 0 !important;
margin: 0 !important;
border: 0 !important;
}
.views-admin-links .links a {
padding: 0 !important;
margin-right: 0.2em !important;
color: #ddd !important;
font-family: Arial;
}
.views-admin-links .links a:hover {
color: #fff !important;
}
#sidebar-left .view-news-items .views-admin-links li {
padding: 0 !important;
}
.admin_hover { background: none; border: 0; margin-left: 1em; margin-top: -1em; }
.admin_hover a { width: 30px !important; height: 30px !important; }
.admin_hover a.admin_hover-node_edit { background: url(g/icon-edit.png) !important; }
.admin_hover a.admin_hover-node_delete { background: url(g/icon-delete.png) !important; }
.admin_hover ul li { border: 0; }
/* --- ADMIN USER EDITOR ---------------------------------------------------------------------------------------- */
/* Integrates the Admin back-end style with the Clips front-end style for the Blocks Editor. */
code,
.syntaxhighlighter table .plain,
.syntaxhighlighter code,
.syntaxhighlighter .line,
.syntaxhighlighter code a,
.syntaxhighlighter textarea,
pre.wysiwyg-syntaxhl,
pre,
.install pre {
font-family: "Inconsolata", "Courier New", Courier, monospace !important;
font-size: 13px !important;
line-height: 1.3em !important;
}
fieldset {
padding: 0.5em;
background: #f4f4f4;
border: 1px solid #ddd;
font: normal 13px "Lucida","Lucida Grande","Trebuchet MS",Tahoma,Verdana,sans-serif;
}
fieldset.collapsed { border: 1px solid #ddd !important; }
fieldset fieldset { background: #f8f8f8 !important; }
fieldset legend, fieldset a, fieldset th { font-family: Arial; }
fieldset legend, fieldset legend a { font-size: 11px; font-weight: bold; color: #333 !important; }
fieldset a { text-decoration: none; color: #3399CC; }
fieldset label, fieldset th { text-transform: uppercase; font-size: 10px; font-weight: bold !important; color: #888; }
fieldset .description { color: #666; }
fieldset input, fieldset select {
margin: 0.2em 0 0.2em 0;
padding: 0.2em;
background: #fff;
border: 1px solid #ccc;
color: #444;
font: normal 12px Arial !important;
}
.section-user .tabs .secondary { margin-top: 1em; }
.section-user .tabs .secondary li a {
border: 0 !important;
}
.section-user #content input.form-submit { margin-top: 2em; }
/* --- ADMIN BLOCKS EDITOR -------------------------------------------------------------------------------------- */
/* Integrates the Admin back-end style with the Clips front-end style for the Blocks Editor. */
.section-admin div.help,
.section-admin div.tabs li,
.section-admin form#block-admin-display-form td,
.section-admin .block-region {
font-family: "Lucida","Lucida Grande","Trebuchet MS",Tahoma,Verdana,sans-serif;
font-size: 11px;
}
.section-admin div.help,
.section-admin .block-region {
margin: 0;
padding: 1em;
}
.section-admin div.help { background: #f4f4f4; border: 1px solid #ddd; }
.section-admin .block-region { margin-top: 3px; background: #d1fff5; border: 1px solid #a7ccc4; }
.section-admin div.tabs { margin: 0px; background: none; }
.section-admin div.tabs * { background: none !important; }
.section-admin div.tabs li,
.section-user .tabs .secondary li,
.logged-in .tabs .secondary li {
height: 28px;
margin-right: 1px;
padding: 0 !important;
background-color: #f4f4f4 !important;
font: normal 11px Arial;
text-transform: uppercase !important;
border: 1px solid #f0f0f0;
border-bottom: 0;
border-radius: 0.6em 0.6em 0 0; -moz-border-radius: 0.6em 0.6em 0 0; -webkit-border-radius: 0.6em 0.6em 0 0;
}
.section-admin div.tabs li a,
.section-user .tabs .secondary li a,
.logged-in .tabs .secondary li a {
border: 0;
text-decoration: none;
}
.section-admin div.tabs li a span,
.section-user .tabs .secondary li a span,
.logged-in .tabs .secondary li a span {
color: #333;
margin: 0.5em 1em 0.5em 1em;
text-transform: capitalize !important;
}
.section-admin div.tabs li:hover,
.section-admin div.tabs li.active,
.section-user div.tabs .secondary li:hover,
.section-user div.tabs .secondary li.active,
.logged-in div.tabs .secondary li:hover,
.logged-in div.tabs .secondary li.active {
background-color: #e4e4e4 !important;
}
.section-admin div.help a,
.section-admin form a,
.section-user form a {
background: none;
text-decoration: none;
}
.section-admin form table,
.section-user form table { width: 100%; }
.section-admin form thead { display: none; }
.section-admin form tr.odd,
.section-user form tr.odd { }
.section-admin form td.region,
.section-user form td.region,
.section-user form thead {
padding-top: 1em;
background: #eee;
font: bold 0.8em Arial;
text-transform: uppercase;
}
.section-admin form td,
.section-user form td,
.section-user form th {
margin: 0;
padding: 0.5em 0.5em 0.5em 1em;
border: 1px solid #ddd;
vertical-align: middle;
line-height: 1em;
font: normal 11px Arial;
}
.section-user form th {
font-weight: bold;
color: #888;
}
.section-admin form a.tabledrag-handle {
padding: 0 1em 0 0;
}
.section-user form { font-family: Arial; }
.section-user form label { text-transform: uppercase; font-size: 10px; font-weight: bold !important; color: #888; }
.section-user form a { color: #3399CC; }
/* --- PAGE STYLES ---------------------------------------------------------------------------------------------- */
/* These are made available through the TinyMCE editor. */
body.mceContentBody {
background: white !important;
background-image: none;
}
.big { font-size: 1.3em; line-height: 1.5em; }
.small { font-size: 0.9em; line-height: 1.45em; }
.caption {
display: block;
font-size: 1.1em;
font-variant: small-caps;
border-bottom: 1px solid #ccc;
margin-bottom: 0.5em;
}
.highlight { color: deeppink !important; }
.tag {
color: #0E5682;
font-size: 1.1em;
font-variant: small-caps;
font-weight: bold;
text-decoration: none;
}
.tag a { text-decoration: none; }
.tag a:hover { text-decoration: underline; }
.link-news { color: orange; }
.link-maintenance, a.link-maintenance, .link-maintenance a { color: rgb(100,140,190); }
.link-colorless { color: #333; }
.postag { font: bold 0.85em Arial; text-transform: uppercase; padding: 0px 1px 0px 1px; }
.inline_code { font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 13px; color: #333; }
.smallcaps { font-size: 1.1em; font-variant: small-caps; }
.blue { color: #0e5682 !important; }
.grey { color: rgb(100,100,100) !important; }
table.border td, td.border, img.border { border: 1px solid #ccc; }
/* Syntax coloring. */
code, pre, .box,
body .syntaxhighlighter,
body pre.wysiwyg-syntaxhl {
padding: 0.2em 0.4em 0.2em 0.4em !important;
background: rgb(220,235,250) !important;
border: 1px solid rgb(200,215,230) !important;
border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em;
}
body .syntaxhighlighter textarea { display: none; }
body .syntaxhighlighter code.plain a,
body .syntaxhighlighter code.string a,
body .syntaxhighlighter code.comments a,
body .syntaxhighlighter code.comments1 a {
color: inherit !important;
text-decoration: none !important;
}
body .syntaxhighlighter code.plain a:hover,
body .syntaxhighlighter code.string a:hover,
body .syntaxhighlighter code.comments a:hover,
body .syntaxhighlighter code.comments1 a:hover {
text-decoration: underline !important;
}
body .syntaxhighlighter {
width: auto !important;
}
body .syntaxhighlighter div code {
border-width: 0px !important;
font: inherit !important;
}
body .syntaxhighlighter div.line.alt1,
body .syntaxhighlighter div.line.alt2 {
background: transparent !important;
padding: 0 0 0 0 !important;
}
body .syntaxhighlighter .gutter .line.alt1,
body .syntaxhighlighter .gutter .line.alt2 {
border-right: 1px solid #adc7d9 !important;
padding-right: 0.5em !important;
margin-right: 0.5em !important;
color: #a3bccc !important;
}
code, body .syntaxhighlighter, pre.wysiwyg-syntaxhl {
margin: 0.7em 0 0.7em 0 !important;
}
code,
body .syntaxhighlighter table .plain, pre.wysiwyg-syntaxhl,
body .syntaxhighlighter textarea {
color: #555 !important;
}
.example code,
.example .syntaxhighlighter,
.example pre.wysiwyg-syntaxhl,
.node-type-script .syntaxhighlighter.nogutter,
.node-type-script pre.wysiwyg-syntaxhl,
pre {
background: rgb(239,246,252) !important;
border: 1px solid rgb(220,223,233) !important;
}
body .node-type-page .syntaxhighlighter {
overflow: hidden !important;
}
.install code span,
.install pre { color: #555 !important; }
.install code,
.install pre,
.install .syntaxhighlighter,
.install pre.wysiwyg-syntaxhl {
background: rgb(239,246,252) !important;
border: 1px solid rgb(220,223,233) !important;
color: #555 !important;
}
/* Javascript syntax */
body .syntaxhighlighter .jscript.keyword1,
body .syntaxhighlighter .javascript.keyword1 {
color: #28334f !important; font-weight: bold !important;
}
body .syntaxhighlighter .jscript.keyword2,
body .syntaxhighlighter .javascript.keyword2,
body .syntaxhighlighter .jscript.keyword3,
body .syntaxhighlighter .javascript.keyword3 {
color: #4a587c !important;
}
body .syntaxhighlighter .jcript.name,
body .syntaxhighlighter .javascript.name {
color: rgb(70, 140, 200) !important;
}
body .syntaxhighlighter .jscript.string,
body .syntaxhighlighter .javascript.string {
color: #657a8a !important;
}
body .syntaxhighlighter .jscript.comments1,
body .syntaxhighlighter .javascript.comments1 {
color: grey !important;
}
body .syntaxhighlighter .jscript.comments2,
body .syntaxhighlighter .javascript.comments2 {
color: #657a8a !important;
}
/* Python syntax */
body .syntaxhighlighter .python.keyword {
color: #28334f !important; font-weight: bold !important;
}
body .syntaxhighlighter .python.name {
color: rgb(70, 140, 200) !important;
}
body .syntaxhighlighter .python.string {
color: #657a8a !important;
}
body .syntaxhighlighter .python.comments1 {
color: #888 !important;
}
body .syntaxhighlighter .python.comments2 {
color: #657a8a !important;
}
body .syntaxhighlighter .python.functions,
body .syntaxhighlighter .python.color1 {
color: #4a587c !important;
}
body .syntaxhighlighter .python.value {
color: #666 !important;
}
/* XML syntax */
body .syntaxhighlighter .xml.keyword {
color: #28334f !important; font-weight: bold !important;
}
body .syntaxhighlighter .xml.string {
color: #657a8a !important;
}
body .syntaxhighlighter .xml.color1 {
color: inherit !important;
}
/* Plaintext */
body .syntaxhighlighter.plain .plain {
color: #6c7780 !important;
}
/* Page formatting. */
.node-type-page #content { width: 700px !important; }
.node-type-page.front #content { width: 610px !important; }
.node-type-page h2 { font-size: 1.50em; }
.node-type-page h3 { font-size: 1.25em; margin-top: 1.5em; margin-bottom: 0.5em; }
.node-type-page.front h2 { font-size: 1.25em; }
.node-type-page.front h3 { font-size: 1.25em; }
.node-type-page h2 a,
.node-type-page h3 a { background: none; padding: 0; }
.node-type-page table { width: 100%; }
.node-type-page table td { padding: 0.2em 0.4em 0.2em 0.4em; }
/* Pattern documentation. */
#node-1350 table td form { margin-left: 25px; } /* PayPal donate */
#node-1350 table td form br { display: none; }
/* --- ADMIN RESOURCE RESERVATIONS ------------------------------------------------------------------------------ */
.page-reservations caption { font-family: "Roboto Slab", Georgia, Times, serif; font-size: 1.2em; text-align: left; margin-bottom: 1em; }
.page-reservations table { width: 100%; }
.page-reservations th, .page-colloquia th { font-size: 1.1em; font-variant: small-caps; padding-bottom: 0.5em; }
.page-reservations td.views-field-field-timeslot-value { background: none; }
.page-reservations th.views-field-edit-node { visibility: hidden; }
.page-reservations td.views-field-edit-node { text-align: right; font-size: 0.9em; }
.page-reservations a { background: none; text-transform: lowercase; }
.page-reservations .date-display-single { font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 1em; }
.page-reservations .date-display-start { }
.page-reservations .date-display-end { }
/* --- ADMIN COLLOQIUA ------------------------------------------------------------------------------------------ */
.page-colloquia .view-header { margin-bottom: 2em; }
.page-colloquia caption { display: none; }
.page-colloquia #content table { width: 100%; }
.page-colloquia #content th { font-size: 1.1em; font-variant: small-caps; padding: 0.5em 1em 0.5em 0; white-space: nowrap; }
.page-colloquia #content td { vertical-align: top; padding: 0.5em 1em 0.5em 0; border: 0; border-top: 1px solid #ccc; }
.page-colloquia #content td strong { font-weight: normal; }
.page-colloquia #content td a:hover { color: rgb(20,120,240); }
.page-colloquia #content td.views-field-field-date-value,
.node-type-colloquium .date-display-single { background: none; font-family: "Inconsolata", "Courier New", Courier, monospace; font-size: 1em; white-space: nowrap; line-height: 1.5em; }
.node-type-colloquium .submitted { display: none; }
.node-type-colloquium .node .content { margin-top: 1em; }
.node-type-colloquium .field { margin-top: 0.5em; }
.node-type-colloquium .field-item { border-bottom: 1px solid #ccc; }
.node-type-colloquium .field-label-inline-first {
font-size: 1.1em;
font-variant: small-caps;
font-weight: normal;
display: block;
float: left;
min-width: 100px;
}
.node-type-colloquium h3 { }
.node-type-colloquium h3 em { font-style: normal; }
.node-type-colloquium .field-field-presenter { margin-bottom: 2em; }
.node-type-colloquium .tabs .primary { margin-bottom: 1em; }
#signup-node-settings-form,
#signup-node-settings-form td { font-family: Arial !important; }
#signup-node-settings-form label { text-transform: uppercase; font-size: 10px; font-weight: bold !important; color: #888; }
#signup-node-settings-form textarea { font-size: 1em; color: #333; }
._page-pages-mbsp { font-size: 9pt; }
================================================
FILE: docs/html/mbsp-tags.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>mbsp-tags</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../clips.css" />
<style>
/* Small fixes because we omit the online layout.css. */
h3 { line-height: 1.3em; }
#page { margin-left: auto; margin-right: auto; }
#header, #header-inner { height: 175px; }
#header { border-bottom: 1px solid #C6D4DD; }
table { border-collapse: collapse; }
#checksum { display: none; }
</style>
<link href="../js/shCore.css" rel="stylesheet" type="text/css" />
<link href="../js/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/shCore.js"></script>
<script language="javascript" src="../js/shBrushXml.js"></script>
<script language="javascript" src="../js/shBrushJScript.js"></script>
<script language="javascript" src="../js/shBrushPython.js"></script>
</head>
<body class="node-type-page one-sidebar sidebar-right section-pages">
<div id="page">
<div id="page-inner">
<div id="header"><div id="header-inner"></div></div>
<div id="content">
<div id="content-inner">
<div class="node node-type-page"
<div class="node-inner">
<div class="breadcrumb">View online at: <a href="http://www.clips.ua.ac.be/pages/mbsp-tags" class="noexternal" target="_blank">http://www.clips.ua.ac.be/pages/mbsp-tags</a></div>
<h1>Penn Treebank II tag set</h1>
<!-- Parsed from the online documentation. -->
<div id="node-1274" class="node node-type-page"><div class="node-inner">
<div class="content">
<p class="big"><a href="pattern.html">Pattern</a> and <a href="http://www.clips.ua.ac.be/pages/MBSP" target="_self">MBSP</a> assign meaningful tags to words and groups of words in a sentence. Each tag is a short code (such as "<span class="postag">DT</span>" for "determiner").</p>
<p>The tag set is based on the Penn Treebank Tagging Guidelines [<a href="ftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz" target="_self">pdf</a>].</p>
<h3>Part-of-speech tags</h3>
<p>Part-of-speech tags are assigned to a single word according to its role in the sentence. Traditional grammar classifies words based on eight parts of speech: the verb (<span class="postag">VB</span>), the noun (<span class="postag">NN</span>), the pronoun (<span class="postag">PR</span>+<span class="postag">DT</span>), the adjective (<span class="postag">JJ</span>), the adverb (<span class="postag">RB</span>), the preposition (<span class="postag">IN</span>), the conjunction (<span class="postag">CC</span>), and the interjection (<span class="postag">UH</span>).</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
<td class="smallcaps">Example</td>
</tr>
<tr>
<td><span class="postag">CC </span></td>
<td>conjunction, coordinating</td>
<td><em>and, or, but</em></td>
</tr>
<tr>
<td><span class="postag">CD </span></td>
<td>cardinal number</td>
<td><em>five, three, 13%</em></td>
</tr>
<tr>
<td><span class="postag">DT </span></td>
<td>determiner</td>
<td><em>the, a, these <br /></em></td>
</tr>
<tr>
<td><span class="postag">EX </span></td>
<td>existential there</td>
<td><em><span style="text-decoration: underline;">there</span> were six boys <br /></em></td>
</tr>
<tr>
<td><span class="postag">FW </span></td>
<td>foreign word</td>
<td><em>mais <br /></em></td>
</tr>
<tr>
<td><span class="postag">IN </span></td>
<td>conjunction, subordinating or preposition</td>
<td><em>of, on, before, unless <br /></em></td>
</tr>
<tr>
<td><span class="postag">JJ </span></td>
<td>adjective</td>
<td><em>nice, easy </em></td>
</tr>
<tr>
<td><span class="postag">JJR </span></td>
<td>adjective, comparative</td>
<td><em>nicer, easier</em></td>
</tr>
<tr>
<td><span class="postag">JJS </span></td>
<td>adjective, superlative</td>
<td><em>nicest, easiest <br /></em></td>
</tr>
<tr>
<td><span class="postag">LS </span></td>
<td>list item marker</td>
<td><em> </em></td>
</tr>
<tr>
<td><span class="postag">MD </span></td>
<td>verb, modal auxillary</td>
<td><em>may, should <br /></em></td>
</tr>
<tr>
<td><span class="postag">NN </span></td>
<td>noun, singular or mass</td>
<td><em>tiger, chair, laughter <br /></em></td>
</tr>
<tr>
<td><span class="postag">NNS </span></td>
<td>noun, plural</td>
<td><em>tigers, chairs, insects <br /></em></td>
</tr>
<tr>
<td><span class="postag">NNP </span></td>
<td>noun, proper singular</td>
<td><em>Germany, God, Alice <br /></em></td>
</tr>
<tr>
<td><span class="postag">NNPS </span></td>
<td>noun, proper plural</td>
<td><em>we met two <span style="text-decoration: underline;">Christmases</span> ago <br /></em></td>
</tr>
<tr>
<td><span class="postag">PDT </span></td>
<td>predeterminer</td>
<td><em><span style="text-decoration: underline;">both</span> his children <br /></em></td>
</tr>
<tr>
<td><span class="postag">POS</span></td>
<td>possessive ending</td>
<td><em>'s</em></td>
</tr>
<tr>
<td><span class="postag">PRP </span></td>
<td>pronoun, personal</td>
<td><em>me, you, it <br /></em></td>
</tr>
<tr>
<td><span class="postag">PRP$ </span></td>
<td>pronoun, possessive</td>
<td><em>my, your, our <br /></em></td>
</tr>
<tr>
<td><span class="postag">RB </span></td>
<td>adverb</td>
<td><em>extremely, loudly, hard <br /></em></td>
</tr>
<tr>
<td><span class="postag">RBR </span></td>
<td>adverb, comparative</td>
<td><em>better <br /></em></td>
</tr>
<tr>
<td><span class="postag">RBS </span></td>
<td>adverb, superlative</td>
<td><em>best <br /></em></td>
</tr>
<tr>
<td><span class="postag">RP </span></td>
<td>adverb, particle</td>
<td><em>about, off, up <br /></em></td>
</tr>
<tr>
<td><span class="postag">SYM </span></td>
<td>symbol</td>
<td><em>% <br /></em></td>
</tr>
<tr>
<td><span class="postag">TO </span></td>
<td>infinitival to</td>
<td><em>what <span style="text-decoration: underline;">to</span> do? <br /></em></td>
</tr>
<tr>
<td><span class="postag">UH </span></td>
<td>interjection</td>
<td><em>oh, oops, gosh <br /></em></td>
</tr>
<tr>
<td><span class="postag">VB </span></td>
<td>verb, base form</td>
<td><em>think <br /></em></td>
</tr>
<tr>
<td><span class="postag">VBZ </span></td>
<td>verb, 3rd person singular present</td>
<td><em>she <span style="text-decoration: underline;">thinks </span><br /></em></td>
</tr>
<tr>
<td><span class="postag">VBP </span></td>
<td>verb, non-3rd person singular present</td>
<td><em>I <span style="text-decoration: underline;">think </span><br /></em></td>
</tr>
<tr>
<td><span class="postag">VBD </span></td>
<td>verb, past tense</td>
<td><em>they <span style="text-decoration: underline;">thought </span><br /></em></td>
</tr>
<tr>
<td><span class="postag">VBN </span></td>
<td>verb, past participle</td>
<td><em>a <span style="text-decoration: underline;">sunken</span> ship <br /></em></td>
</tr>
<tr>
<td><span class="postag">VBG </span></td>
<td>verb, gerund or present participle</td>
<td><em><span style="text-decoration: underline;">thinking</span> is fun <br /></em></td>
</tr>
<tr>
<td><span class="postag">WDT </span></td>
<td><em>wh</em>-determiner</td>
<td><em>which, whatever, whichever <br /></em></td>
</tr>
<tr>
<td><span class="postag">WP </span></td>
<td><em>wh</em>-pronoun, personal</td>
<td><em>what, who, whom <br /></em></td>
</tr>
<tr>
<td><span class="postag">WP$</span></td>
<td><em>wh</em>-pronoun, possessive</td>
<td><em>whose, whosever <br /></em></td>
</tr>
<tr>
<td><span class="postag">WRB</span></td>
<td><em>wh</em>-adverb</td>
<td><em>where, when <br /></em></td>
</tr>
<tr>
<td><span class="postag">. </span></td>
<td>punctuation mark, sentence closer</td>
<td><em>.;?* <br /></em></td>
</tr>
<tr>
<td><span class="postag">, </span></td>
<td>punctuation mark, comma</td>
<td><em>, <br /></em></td>
</tr>
<tr>
<td><span class="postag">: </span></td>
<td>punctuation mark, colon</td>
<td><em>: <br /></em></td>
</tr>
<tr>
<td><span class="postag">( </span></td>
<td>contextual separator, left paren</td>
<td><em>( <br /></em></td>
</tr>
<tr>
<td><span class="postag">) </span></td>
<td>contextual separator, right paren</td>
<td><em>) <br /></em></td>
</tr>
</tbody>
</table>
<h3>Chunk tags</h3>
<p>Chunk tags are assigned to groups of words that belong together (i.e. phrases). The most common phrases are the noun phrase (<span class="postag">NP</span>, for example <em>the black cat</em>) and the verb phrase (<span class="postag">VP</span>, for example <em>is purring</em>).</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
<td><span class="smallcaps">Words </span></td>
<td><span class="smallcaps">Example </span></td>
<td align="right">%</td>
</tr>
<tr>
<td><span class="postag">NP </span></td>
<td>noun phrase<span class="postag"> </span></td>
<td><span class="postag">DT</span>+<span class="postag">RB</span>+<span class="postag">JJ</span>+<span class="postag">NN</span> + <span class="postag">PR</span></td>
<td><em>the strange bird</em></td>
<td align="right"> 51</td>
</tr>
<tr>
<td><span class="postag">PP </span></td>
<td>prepositional phrase</td>
<td><span class="postag">TO</span>+<span class="postag">IN </span></td>
<td><em>in between</em></td>
<td align="right"> 19</td>
</tr>
<tr>
<td><span class="postag">VP </span></td>
<td>verb phrase </td>
<td><span class="postag">RB</span>+<span class="postag">MD</span>+<span class="postag">VB </span></td>
<td><em>was looking<br /></em></td>
<td align="right">9</td>
</tr>
<tr>
<td><span class="postag">ADVP</span></td>
<td>adverb phrase</td>
<td><span class="postag">RB</span></td>
<td><em>also<br /></em></td>
<td align="right"> 6</td>
</tr>
<tr>
<td><span class="postag">ADJP</span></td>
<td>adjective phrase<span class="postag"> </span></td>
<td><span class="postag">CC</span>+<span class="postag">RB</span>+<span class="postag">JJ</span></td>
<td><em>warm and cosy</em></td>
<td align="right"> 3</td>
</tr>
<tr>
<td><span class="postag">SBAR</span></td>
<td>subordinating conjunction </td>
<td><span class="postag">IN</span></td>
<td><em><span style="text-decoration: underline;">whether</span> or not<br /></em></td>
<td align="right">3</td>
</tr>
<tr>
<td><span class="postag">PRT </span></td>
<td>particle</td>
<td><span class="postag">RP</span></td>
<td><em><span style="text-decoration: underline;">up</span> the stairs</em></td>
<td align="right"> 1</td>
</tr>
<tr>
<td><span class="postag">INTJ</span></td>
<td>interjection</td>
<td><span class="postag">UH</span></td>
<td><em>hello</em><em><br /></em></td>
<td align="right"> 0</td>
</tr>
</tbody>
</table>
<p>The IOB prefix marks whether a word is inside or outside of a chunk.</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
</tr>
<tr>
<td><span class="postag">I-</span></td>
<td>inside the chunk</td>
</tr>
<tr>
<td><span class="postag">B-</span></td>
<td>inside the chunk, preceding word is part of a different chunk</td>
</tr>
<tr>
<td><span class="postag">O </span></td>
<td>not part of a chunk</td>
</tr>
</tbody>
</table>
<p>A prepositional noun phrase (<span class="postag">PNP</span>) is a group of chunks starting with a preposition (<span class="postag">PP</span>) followed by noun phrases (<span class="postag">NP</span>), for example: <em>under the table</em>.</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
<td class="smallcaps">Chunks</td>
<td><span class="smallcaps">Example </span></td>
</tr>
<tr>
<td><span class="postag">PNP</span></td>
<td>prepositional noun phrase</td>
<td><span class="postag">PP</span>+<span class="postag">NP</span><span class="postag"> </span></td>
<td><em>as of today</em></td>
</tr>
</tbody>
</table>
<h3>Relation tags</h3>
<p>Relations tags describe the relation between different chunks, and clarify the role of a chunk in that relation. The most common roles in a sentence are <span class="postag">SBJ</span> (subject noun phrase) and <span class="postag">OBJ</span> (object noun phrase). They link <span class="postag">NP</span> to <span class="postag">VP</span> chunks. The subject of a sentence is the person, thing, place or idea that is <em>doing</em> or <em>being</em> something. The object of a sentence is the person/thing affected by the action.</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
<td class="smallcaps">Chunks</td>
<td><span class="smallcaps">Example </span></td>
<td align="right"><span class="smallcaps">%</span></td>
</tr>
<tr>
<td><span class="postag">-SBJ</span></td>
<td>sentence subject</td>
<td><span class="postag">NP</span><span class="postag"> </span></td>
<td><em><span style="text-decoration: underline;">the cat</span> sat on the mat<br /></em></td>
<td align="right">35</td>
</tr>
<tr>
<td><span class="postag">-OBJ</span></td>
<td>sentence object</td>
<td><span class="postag">NP</span>+<span class="postag">SBAR</span></td>
<td><em>the cat grabs <span style="text-decoration: underline;">the fish</span><br /></em></td>
<td align="right">27</td>
</tr>
<tr>
<td><span class="postag">-PRD </span></td>
<td>predicate</td>
<td><span class="postag">PP</span>+<span class="postag">NP</span>+<span class="postag">ADJP </span></td>
<td><em>the cat feels <span style="text-decoration: underline;">warm and fuzzy</span><br /></em></td>
<td align="right">7</td>
</tr>
<tr>
<td><span class="postag">-TMP</span></td>
<td>temporal </td>
<td><span class="postag">PP</span>+<span class="postag">NP</span>+<span class="postag">ADVP</span></td>
<td><em>arrive </em><em><span style="text-decoration: underline;">at noon</span> <br /></em></td>
<td align="right">7</td>
</tr>
<tr>
<td><span class="postag">-CLR </span></td>
<td>closely related</td>
<td><span class="postag">PP</span>+<span class="postag">NP</span>+<span class="postag">ADVP </span></td>
<td><em>work </em><em><span style="text-decoration: underline;">as a researcher</span> <br /></em></td>
<td align="right">6</td>
</tr>
<tr>
<td><span class="postag">-LOC</span></td>
<td>location </td>
<td><span class="postag">PP </span></td>
<td><em>live </em><em><span style="text-decoration: underline;">in Belgium</span> <br /></em></td>
<td align="right">4</td>
</tr>
<tr>
<td><span class="postag">-DIR </span></td>
<td>direction</td>
<td><span class="postag">PP </span></td>
<td><em>walk</em><em> <span style="text-decoration: underline;">towards</span> the door<br /></em></td>
<td align="right">3</td>
</tr>
<tr>
<td><span class="postag">-EXT</span></td>
<td>extent</td>
<td><span class="postag">PP</span>+<span class="postag">NP </span></td>
<td><em>drop <span style="text-decoration: underline;">10 %</span><br /></em></td>
<td align="right">1</td>
</tr>
<tr>
<td><span class="postag">-PRP</span></td>
<td>purpose</td>
<td><span class="postag">PP</span>+<span class="postag">SBAR </span></td>
<td><em>die <span style="text-decoration: underline;">as a result</span> of <br /></em></td>
<td align="right">1</td>
</tr>
</tbody>
</table>
<h3>Anchor tags</h3>
<p>Anchor tags describe how prepositional noun phrases (<span class="postag">PNP</span>) are attached to other chunks in the sentence. For example, in the sentence, <em>I eat pizza with a fork</em>, the anchor of <em>with a fork</em> is <em>eat</em> because it answers the question: "In what way do I eat?"</p>
<table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Tag </span></td>
<td><span class="smallcaps">Description </span></td>
<td><span class="smallcaps">Example </span></td>
</tr>
<tr>
<td><span class="postag">A1</span></td>
<td>anchor chunks that corresponds to <span class="postag">P1</span></td>
<td><em><span style="text-decoration: underline;">eat</span> with a fork<br /></em></td>
</tr>
<tr>
<td><span class="postag">P1 </span></td>
<td><span class="postag">PNP</span> that corresponds to <span class="postag">A1 </span></td>
<td><em>eat <span style="text-decoration: underline;">with a fork</span><br /></em></td>
</tr>
</tbody>
</table>
<p> </p>
<p><strong>Occurence estimate </strong><span class="small"><br /></span></p>
<p><span class="small">The given percentages for chunk and relations tags are based on tenfold cross validation on sections 10 to 19 of the WSJ Corpus of the Penn Treebank II by Sabine Buchholz, from which we derived a rough indication. The estimate means that if a 100 chunk tags are found, about 50 would be <span class="postag">NP</span> tags and 35 would have a <span class="postag">SBJ</span> relation tag. About 30 of the chunks would be tagged as <span class="postag">NP-SBJ</span>, and 15 as <span class="postag">NP-OBJ</span>. </span></p>
<p><span class="small"><span style="text-decoration: underline;">Reference</span>: Buchholz, S. (2002). <em>Memory-Based Grammatical Relation Finding</em>. ILK, Tilburg University.</span></p>
</div>
</div></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
SyntaxHighlighter.all();
</script>
</body>
</html>
================================================
FILE: docs/html/pattern-canvas.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>pattern-canvas</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../clips.css" />
<style>
/* Small fixes because we omit the online layout.css. */
h3 { line-height: 1.3em; }
#page { margin-left: auto; margin-right: auto; }
#header, #header-inner { height: 175px; }
#header { border-bottom: 1px solid #C6D4DD; }
table { border-collapse: collapse; }
#checksum { display: none; }
</style>
<link href="../js/shCore.css" rel="stylesheet" type="text/css" />
<link href="../js/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/shCore.js"></script>
<script language="javascript" src="../js/shBrushXml.js"></script>
<script language="javascript" src="../js/shBrushJScript.js"></script>
<script language="javascript" src="../js/shBrushPython.js"></script>
</head>
<body class="node-type-page one-sidebar sidebar-right section-pages">
<div id="page">
<div id="page-inner">
<div id="header"><div id="header-inner"></div></div>
<div id="content">
<div id="content-inner">
<div class="node node-type-page"
<div class="node-inner">
<div class="breadcrumb">View online at: <a href="http://www.clips.ua.ac.be/pages/pattern-canvas" class="noexternal" target="_blank">http://www.clips.ua.ac.be/pages/pattern-canvas</a></div>
<h1>pattern.canvas</h1>
<!-- Parsed from the online documentation. -->
<div id="node-1481" class="node node-type-page"><div class="node-inner">
<div class="content">
<p><span class="big">The canvas.js module is a simple and robust JavaScript API for the HTML5 <canvas> element, which can be used to generate interactive 2D graphics in a web browser, using lines, shapes, paths, images and text.</span></p>
<p>The module is part of the <a href="pattern.html">pattern</a> package: <a href="pattern-web.html">web</a> | <a href="pattern-db.html">db</a> | <a href="pattern-en.html">en</a> | <a href="pattern-search.html">search</a> | <a href="pattern-vector.html">vector</a> | <a href="pattern-graph.html">graph</a>.</p>
<table border="0">
<tbody>
<tr>
<td style="width: 30px;">
<p><img src="../g/download3.gif" alt="" width="30" height="30" /></p>
</td>
<td valign="bottom">
<p><span class="smallcaps">Download:</span><strong class="smallcaps"><br /></strong><a href="http://www.clips.ua.ac.be/cgi-bin/tom/api/minify.cgi?filename=canvas.js&url=https%3A%2F%2Fraw.github.com%2Fclips%2Fpattern%2Fmaster%2Fpattern%2Fcanvas.js">canvas.js</a> (120KB)<br /><a href="http://www.clips.ua.ac.be/cgi-bin/tom/api/minify.cgi?filename=canvas.compressed.js&url=https%3A%2F%2Fraw.github.com%2Fclips%2Fpattern%2Fmaster%2Fpattern%2Fcanvas.js&compressed=1">canvas.compressed.js</a> (65KB) </p>
</td>
</tr>
</tbody>
</table>
<p> </p>
<hr />
<h2>Documentation</h2>
<table style="width: auto; white-space: nowrap;" border="0">
<tbody>
<tr>
<td style="padding-right: 35px;"><span class="smallcaps">Drawing</span>
<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#coordinates">Coordinate system</a></li>
<li><a href="#color">Color</a></li>
<li><a href="#transformation">Transformation</a></li>
<li><a href="#primitives">Primitives</a></li>
<li><a href="#path">Path</a></li>
<li><a href="#image">Image</a></li>
<li><a href="#text">Text</a></li>
<li><a href="#mouse">Mouse & keyboard</a></li>
<li><a href="#canvas">Canvas</a></li>
</ul>
</td>
<td style="padding-right: 35px;"><span style="font-variant: small-caps;">Data</span>
<ul>
<li><a href="#widget">Widgets</a></li>
<li><a href="#json">JSON</a></li>
</ul>
</td>
<td style="padding-right: 35px;">Helper functions
<div>
<ul>
<li><a href="#geometry">Geometry</a></li>
<li><a href="#array">Arrays</a></li>
</ul>
</div>
<p> </p>
</td>
</tr>
</tbody>
</table>
<p> </p>
<hr />
<h2><a name="introduction"></a>Introduction</h2>
<p>A <span class="inline_code">canvas.js</span> animation is written in JavaScript code as part of a HTML file. It will run in all modern web browsers (Chrome, Firefox, IE7+, Safari, Opera). Performance may vary from browser to browser. Animations on mobile devices are (currently) quite slow.</p>
<h3>Quick overview</h3>
<p>Below is an example script. The HTML source imports the JavaScript <span class="inline_code">canvas.js</span> module with the standard set of drawing commands. Note the <span class="inline_code"><script type="text/canvas"></span> that defines the animation. It has a <span class="inline_code">setup()</span> function that will be executed once when the animation starts, and a <span class="inline_code">draw()</span> function that will be executed each animation frame.</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;"><!doctype html>
<html>
<head>
<script type="text/javascript" src="canvas.js"></script>
</head>
<body>
<script type="text/canvas">
function setup(canvas) {
canvas.size(500, 500);
}
function draw(canvas) {
canvas.clear();
translate(250, 250);
rotate(canvas.frame);
rect(-150, -150, 300, 300, {fill: color(1,0,0,1)});
}
</script>
</body>
</html></pre></div>
<h3 class="example">Syntax</h3>
<p>Functions can have parameters with default values. For example, the <span class="inline_code">star()</span> function takes two to five parameters in the right order (<span class="inline_code">x</span>, <span class="inline_code">y</span>, <span class="inline_code">points</span>, <span class="inline_code">outer</span> and <span class="inline_code">inner</span>). If you supply four parameters, the fifth parameter assumes a default value (<span class="inline_code">inner=50</span>). If you need to define the fifth parameter, you must define all parameters preceding it. Contrarily, some functions have optional, named parameters. For example, the <span class="inline_code">rect()</span> function takes four parameters and a fifth, optional <span class="inline_code">roundness</span>.</p>
<p>If you want to set <span class="inline_code">roundness</span>, you must supply it by name and enclosed in curly braces. If the documentation mentions other optional parameters you can supply these as well inside the curly braces, in any order. For example: <span class="inline_code">rect(50,</span> <span class="inline_code">50,</span> <span class="inline_code">100,</span> <span class="inline_code">100,</span> <span class="inline_code">{roundness:</span> <span class="inline_code">0.2,</span> <span class="inline_code">fill:</span> <span class="inline_code">color(1,0,0)});</span></p>
<h3>Editor</h3>
<p>You can use the <a href="http://www.clips.ua.ac.be/media/canvas/" target="_blank">online editor</a> (with syntax coloring and live editing) for sketching and testing. It runs in Chrome, FireFox and Safari. You can import example scripts from <span class="inline_code">pattern/examples/07-canvas/</span> or export new scripts (remember to change the <span class="inline_code"><script></span> link to <span class="inline_code">canvas.js</span> in the HTML source). The editor will provide hintz when an error occurs, but the best way to track errors is to use the browser's developer tools (e.g., FireBug).</p>
<p style="text-align: center;"><a title="Open canvas.js editor" href="http://www.clips.ua.ac.be/media/canvas/" target="_blank"><img src="../g/pattern-canvas-editor2.jpg" alt="" width="610" height="610" /></a><br /><span class="small">pattern/examples/07-canvas/09-class.html</span></p>
<p style="text-align: left;"> </p>
<hr />
<h2><a name="coordinates"></a>Coordinate system</h2>
<p>By, default, the canvas origin (0, 0) is located in the upper-left corner. The origin can be moved (or <em>translated</em>) with the <span class="inline_code">translate()</span> function, where positive numbers define the amount of pixels to move right and down.</p>
<table>
<tbody>
<tr>
<td><img class="border" src="../g/pattern-canvas-origin1.jpg" alt="" /></td>
<td>
<p>When the origin is translated to (100, 80), all subsequent shapes drawn at (0, 0) originate from this point. A shape is drawn, rotated and scaled from its top-left corner – except ellipses which are always drawn from their center.</p>
</td>
</tr>
<tr>
<td><img class="border" src="../g/pattern-canvas-origin2.jpg" alt="" /></td>
<td>
<p>When the origin is translated to (100, 80) and a rectangle with a width of and height of 100 is then drawn at (-50, -50), it will have its center at the origin point, as illustrated in the figure on the left:</p>
<p class="inline_code">translate(100, 80)<br />rotate(45)<br />rect(-50, -50, 100, 100) </p>
</td>
</tr>
</tbody>
</table>
<p> </p>
<hr />
<h2><a name="color"></a>Color</h2>
<p>The <span class="inline_code">Color</span> object can be used to store a color in terms of R,G,B,A channel values (red, green, blue and alpha). It can be passed to <span class="inline_code">background()</span>, <span class="inline_code">fill()</span> and <span class="inline_code">stroke()</span> to set the current drawing color for primitives.</p>
<p>A color can be initialized with either four values (R,G,B,A), three values (R,G,B), two values (grayscale + alpha) or one value (grayscale, a <span class="inline_code">Color</span>, or an <span class="inline_code">[R,G,B,A]</span> array). An optional <span class="inline_code">base</span> parameter defines the range of the given values (e.g., 0-255 instead of 0.0-1.0). An optional <span class="inline_code">colorspace</span> defines the color space of the given parameters: <span class="inline_code">HSB</span> expects hue, saturation, brightness and alpha instead of red, green, blue and alpha.</p>
<pre class="brush:javascript; gutter:false; light:true;">var clr = new Color(r, g, b, a, {base: 1.0, colorspace: RGB});</pre><pre class="brush:javascript; gutter:false; light:true;">var clr = new Color(r, g, b);</pre><pre class="brush:javascript; gutter:false; light:true;">var clr = new Color(grayscale, a);</pre><pre class="brush:javascript; gutter:false; light:true;">var clr = new Color(grayscale);</pre><pre class="brush:javascript; gutter:false; light:true;">var clr = new Color(clr);</pre><pre class="brush:javascript; gutter:false; light:true;">clr.r // Red value between 0.0-1.0.
clr.g // Green value between 0.0-1.0.
clr.b // Blue value between 0.0-1.0.
clr.a // Alpha value between 0.0-1.0.</pre><pre class="brush:javascript; gutter:false; light:true;">clr.rgba() // Returns an array of [R,G,B,A]-values.
clr.map({base: 1.0, colorspace: RGB}) // Returns an array of [R,G,B,A]-values.
clr.rotate(angle) // Returns a new Color.
clr.adjust({hue: 0, saturation: 1, brightness: 1}) </pre><pre class="brush:javascript; gutter:false; light:true;">clr.copy() </pre><ul>
<li><span class="inline_code">Color.map()</span> returns an array of channel values mapped to the given base and colorspace.
<br />For example: <span class="inline_code">clr.map({base: 255, colorspace: HSB})</span> <br />yields an <span class="inline_code">[H,S,B,A]</span> array of values between 0-255.</li>
<li><span class="inline_code">Color.rotate()</span> returns a color with hue rotated on the <a href="http://kuler.adobe.com/#create/fromacolor" target="_blank">RYB color wheel</a> by the given angle.</li>
<li><span class="inline_code">Color.adjust()</span> returns a color with added <span class="inline_code">hue</span> and multiplied <span class="inline_code">saturation</span> and <span class="inline_code">brightness</span> (values between 0.0-1.0).</li>
</ul>
<h3>Color state functions</h3>
<p>The color() function returns a new <span class="inline_code">Color</span>. The <span class="inline_code">background()</span>, <span class="inline_code">fill()</span> and <span class="inline_code">stroke()</span> functions set the current canvas background, shape fill and shape outline color respectively. All subsequently drawn primitives (e.g., lines, ellipses) will use the current fill and outline color. Each function takes the same parameters as a <span class="inline_code">Color</span> object (R,G,B,A | R,G,B | grayscale + alpha | <span class="inline_code">Color</span> | <span class="inline_code">[R,G,B,A]</span>). Each function returns its current setting. </p>
<p>The <span class="inline_code">strokewidth()</span> function sets the width of the outline.</p>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">color(r, g, b, a, {base: 1.0, colorspace: RGB})</pre><pre class="brush:javascript; gutter:false; light:true;">background(r, g, b, a)</pre><pre class="brush:javascript; gutter:false; light:true;">fill(r, g, b, a)</pre><pre class="brush:javascript; gutter:false; light:true;">stroke(r, g, b, a)</pre><pre class="brush:javascript; gutter:false; light:true;">nofill()</pre><pre class="brush:javascript; gutter:false; light:true;">nostroke()</pre><pre class="brush:javascript; gutter:false; light:true;">strokewidth(width)</pre><h3>Color filters</h3>
<p>A color filter returns a new <span class="inline_code">Color</span> that is a variation of the given color, useful for constructing a set of colors that look aesthetically pleasing together. The <span class="inline_code">darker()</span> and <span class="inline_code">lighter()</span> functions modify the color's brightness in HSB, <span class="inline_code">complement()</span> returns the color that is opposite on the RYB color wheel, <span class="inline_code">analog()</span> returns a random adjacent color on the color wheel.</p>
<pre class="brush:javascript; gutter:false; light:true;">darker(clr, step=0.2) // Returns a new Color.</pre><pre class="brush:javascript; gutter:false; light:true;">lighter(clr, step=0.2) // Returns a new Color. </pre><pre class="brush:javascript; gutter:false; light:true;">complement(clr) // Returns a new Color. </pre><pre class="brush:javascript; gutter:false; light:true;">analog(clr, angle=20, d=0.1) // d = random percentage saturation & brightness.</pre><h3>Color gradient</h3>
<p>The <span class="inline_code">Gradient</span> object can be used to create a smooth <span class="inline_code">LINEAR</span> or <span class="inline_code">RADIAL</span> transition between two <span class="inline_code">Color</span> objects. It can be passed to <span class="inline_code">fill()</span> instead of a solid color.</p>
<pre class="brush:javascript; gutter:false; light:true;">var g = new Gradient(clr1, clr2, {type: LINEAR, x: 0, y: 0, spread: 100, angle: 0});</pre><h3>Shadows</h3>
<p>The <span class="inline_code">shadow()</span> function enables drop shadows for all subsequently drawn shapes:</p>
<pre class="brush:javascript; gutter:false; light:true;">shadow(dx=5, dy=5, blur=5, alpha=0.5)</pre><pre class="brush:javascript; gutter:false; light:true;">noshadow()</pre><p> </p>
<hr />
<h2><a name="transformation"></a>Transformation</h2>
<p>The <span class="inline_code">translate()</span> function sets the current origin point for primitives, paths, images and text. By default the origin is (0, 0), the <strong>upper left</strong> corner of the canvas. With <span class="inline_code">translate(100,100)</span>, the current origin becomes (100, 100). If <span class="inline_code">translate(-50,0)</span> is then called, the current origin becomes (50, 100). In the same way, <span class="inline_code">rotate(30)</span> followed by <span class="inline_code">rotate(60)</span> sets the current rotation for all subsequent shapes to 90°.</p>
<p>The <span class="inline_code">push()</span> and <span class="inline_code">pop()</span> functions create a nested branch in the current transformation state. The effect of <span class="inline_code">translate()</span>, <span class="inline_code">rotate()</span> and <span class="inline_code">scale()</span> after a <span class="inline_code">push()</span> only lasts until <span class="inline_code">pop()</span> is called. The <span class="inline_code">reset()</span> function resets all transformations (origin (0, 0), no rotation, scale 100%).</p>
<pre class="brush:javascript; gutter:false; light:true;">translate(x, y) // Push horizontal and vertical offset.</pre><pre class="brush:javascript; gutter:false; light:true;">rotate(degrees) // Push angle in degrees.</pre><pre class="brush:javascript; gutter:false; light:true;">scale(x, y=None) // Push relative scale: 1.0 = 100%</pre><pre class="brush:javascript; gutter:false; light:true;">push()</pre><pre class="brush:javascript; gutter:false; light:true;">pop()</pre><pre class="brush:javascript; gutter:false; light:true;">reset()</pre><p> </p>
<hr />
<h2><a name="primitives"></a>Primitives</h2>
<p>Geometric primitives are the simplest shapes that can be drawn to the canvas: <em>line</em>, <em>rectangle</em>, <em>triangle</em>, <em>ellipse</em>, and two additional shapes, <em>arrow</em> and <em>star</em>.</p>
<table class="border">
<tbody>
<tr>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives1.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">line</span></td>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives2.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">rect</span></td>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives3.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">triangle</span></td>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives4.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">ellipse</span></td>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives5.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">arrow</span></td>
<td style="text-align: center;"><img src="../g/pattern-canvas-primitives6.jpg" alt="" width="80" height="80" /><br /><span class="smallcaps">star</span></td>
</tr>
</tbody>
</table>
<pre class="brush:javascript; gutter:false; light:true;">line(x0, y0, x1, y1)</pre><pre class="brush:javascript; gutter:false; light:true;">rect(x, y, width, height, {roundness: 0.0})</pre><pre class="brush:javascript; gutter:false; light:true;">triangle(x1, y1, x2, y2, x3, y3)</pre><pre class="brush:javascript; gutter:false; light:true;">ellipse(x, y, width, height)</pre><pre class="brush:javascript; gutter:false; light:true;">arrow(x, y, width)</pre><pre class="brush:javascript; gutter:false; light:true;">star(x, y, points=20, outer=100, inner=50)</pre><p>Drawn primitives will adhere to the current color and transformation state. The color state can be overridden by passing an optional <span class="inline_code">fill</span>, <span class="inline_code">stroke</span>, <span class="inline_code">strokewidth</span> to the function, for example:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">function draw(canvas) {
canvas.clear();
nofill();
stroke(0, 0.25);
strokewidth(1);
rect( 50, 50, 50, 50);
rect(110, 50, 50, 50, {stroke: color(0)});
rect(170, 50, 50, 50);
} </pre></div>
<p> </p>
<hr />
<h2><a name="path"></a>Path</h2>
<h3><span style="font-size: 16px;">Path element</span></h3>
<p>The <span class="inline_code">PathElement</span> object defines a single point in a <span class="inline_code">Path</span>. Its <span class="inline_code">cmd</span> property defines the kind of segment from the previous point to this point: <span class="inline_code">MOVETO</span>, <span class="inline_code">LINETO</span>, <span class="inline_code">CURVETO</span> or <span class="inline_code">CLOSE</span>. For curve segments, the point has <span class="inline_code">ctrl1</span> and <span class="inline_code">ctrl2</span> properties that define the control handles of the curve:</p>
<ul>
<li><span class="inline_code">ctrl1</span> describes the direction and magnitude of the curve starting from the previous point,</li>
<li><span class="inline_code">ctrl2</span> describes the direction and magnitude of the curve ending in this point.</li>
</ul>
<pre class="brush:javascript; gutter:false; light:true;">var pt = new PathElement(x, y, cmd);</pre><pre class="brush:javascript; gutter:false; light:true;">pt.cmd // MOVETO, LINETO, CURVETO, CLOSE
pt.x // Horizontal offset.
pt.y // Vertical offset.
pt.ctrl1.x
pt.ctrl1.y
pt.ctrl2.x
pt.ctrl2.y</pre><pre class="brush:javascript; gutter:false; light:true;">pt.copy() // Returns a copy of the point.</pre><h3>Bézier Path</h3>
<p>The <span class="inline_code">Path</span> object contains an array of <span class="inline_code">PathElement</span> objects. The points in a path can easily be traversed in a <span class="inline_code">for</span>-loop. New points can be added to the path with the <span class="inline_code">moveto()</span>, <span class="inline_code">lineto(</span>), <span class="inline_code">curveto()</span> methods.</p>
<pre class="brush:javascript; gutter:false; light:true;">var path = new Path(path=null);</pre><pre class="brush:javascript; gutter:false; light:true;">path.array
path.array.push(pathelement)
</pre><pre class="brush:javascript; gutter:false; light:true;">path.moveto(x, y)
path.lineto(x, y)
path.curveto(x1, y1, x2, y2, x3, y3)
path.closepath()</pre><pre class="brush:javascript; gutter:false; light:true;">path.rect(x, y, width, height, {roundness: 0.0})
path.ellipse(x, y, width, height)</pre><pre class="brush:javascript; gutter:false; light:true;">path.length() // Returns the length of the path.
path.contains(x, y) // Returns true if (x, y) in path.
path.angle(t) // Returns tangent angle at t.
path.point(t) // Returns PathElement at t.
path.points(amount, {start: 0.0, end: 1.0})
</pre><pre class="brush:javascript; gutter:false; light:true;">path.draw({fill: Color, stroke: Color, strokewidth: 1.0}) </pre><pre class="brush:javascript; gutter:false; light:true;">path.copy()</pre><ul>
<li><span class="inline_code">Path.points()</span> and <span class="inline_code">Path.point(</span>) return <span class="inline_code">DynamicPathElement</span> objects. <br />These are dynamically calculated using linear interpolation based on a given time <span class="inline_code">t</span> <br />(where <span class="inline_code">t=0.0</span> is the start of the path and <span class="inline_code">t=1.0</span> is the end of the path).</li>
<li><span class="inline_code">Path.draw()</span> draws the path to the canvas.<br />Optional parameters include <span class="inline_code">fill</span>, <span class="inline_code">stroke</span> and <span class="inline_code">strokewidth</span>.</li>
</ul>
<h3>Path state functions</h3>
<p>The <span class="inline_code">beginpath(</span>) function starts a new current path at (x, y). Points can be added to the current path with <span class="inline_code">moveto()</span>, <span class="inline_code">lineto()</span>, <span class="inline_code">curveto()</span> until <span class="inline_code">endpath()</span> is called and the path is drawn (or returned). </p>
<p>The <span class="inline_code">drawpath()</span> function draws a <span class="inline_code">Path</span> using the current color and transformation state. The color state can be overridden by passing an optional <span class="inline_code">fill</span>, <span class="inline_code">stroke</span> and/or <span class="inline_code">strokewidth</span> to the function. </p>
<p>The <span class="inline_code">findpath()</span> function takes an array of <span class="inline_code">[x,y]</span> coordinates (or <span class="inline_code">PathElement</span> or <span class="inline_code">Point</span> objects) and returns a smooth <span class="inline_code">Path</span>.</p>
<pre class="brush:javascript; gutter:false; light:true;">autoclosepath(close=true)
</pre><pre class="brush:javascript; gutter:false; light:true;">beginpath(x, y)</pre><pre class="brush:javascript; gutter:false; light:true;">moveto(x, y)</pre><pre class="brush:javascript; gutter:false; light:true;">lineto(x, y)</pre><pre class="brush:javascript; gutter:false; light:true;">curveto(x1, y1, x2, y2, x3, y3)</pre><pre class="brush:javascript; gutter:false; light:true;">closepath()</pre><pre class="brush:javascript; gutter:false; light:true;">endpath({draw: true}) // Returns a Path. </pre><pre class="brush:javascript; gutter:false; light:true;">drawpath(path, {fill: Color, stroke: Color, strokewidth: 1.0}) </pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">findpath(points)</pre><h3>Path iteration</h3>
<p>The <span class="inline_code">derive()</span> function iterates over the points in a path (<span class="inline_code">Path</span> or array of <span class="inline_code">PathElement</span> objects) and passes each tangent angle and point to a given callback function. The tangent angle represents the direction of a point in the path. To get the normal (i.e. perpendicular) of a point, rotate its angle by +90 or -90.</p>
<pre class="brush:javascript; gutter:false; light:true;">derive(points, callback)
</pre><p>This is useful if you want to have shapes following a path, for example, to fit text on a path:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">function setup(canvas) {
path = new Path();
path.moveto(100, 50);
path.curveto(200, 100, 300, 0, 400, 50);
txt = 'pattern canvas.js'; // We'll draw each character separately.
}
function draw(canvas) {
canvas.clear();
fill(0);
fontsize(16);
var i = 0;
var points = path.points(txt.length, {start: 0.05, end: 0.95});
derive(points, function(angle, pt) {
push();
translate(pt.x, pt.y);
rotate(angle);
text(txt[i], -textwidth(txt[i])/2, 0);
pop();
i++;
});
drawpath(path, {fill: null, stroke: [0,0,0,0.5]});
}</pre></div>
<table class="border">
<tbody>
<tr>
<td><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-path1.jpg" alt="" /></td>
</tr>
</tbody>
</table>
<p>Supershape</p>
<p>The <span class="inline_code">supershape()</span> command can be used to generate a range of natural-looking shapes (Gielis, 2003).<br />It returns a <span class="inline_code">Path</span> that can be drawn with <span class="inline_code">drawpath()</span>.</p>
<table class="border">
<tbody>
<tr>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-supershape1.jpg" alt="" /></p>
<p class="small" style="text-align: center;">m=3, n1=1.0, n2=1.0, n3=1.0</p>
</td>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-supershape2.jpg" alt="" width="120" height="120" /></p>
<p class="small" style="text-align: center;">m=1, n1=0.65, n2=0.35, n3=0.35</p>
</td>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-supershape3.jpg" alt="" width="120" height="120" /></p>
<p class="small" style="text-align: center;">m=16, n1=1.5, n2=0.5, n3=-0.75</p>
</td>
</tr>
</tbody>
</table>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">supershape(x, y, width, height, m, n1, n2, n3, {points: 100, percentage: 1.0})</pre><h3>Clipping mask</h3>
<p>Drawing functions between <span class="inline_code">beginclip()</span> and <span class="inline_code">endclip()</span> are constrained to the shape of the given path.</p>
<pre class="brush:javascript; gutter:false; light:true;">beginclip(path)</pre><pre class="brush:javascript; gutter:false; light:true;">endclip()</pre><p> </p>
<hr />
<h2><a name="image"></a>Image</h2>
<p>The <span class="inline_code">image()</span> function draws an image to the canvas. It can load a PNG, JPEG or GIF from a given URL. However, images are loaded asynchronously, i.e., the browser is idle while the image downloads in the background. The safe way is to <strong>preload</strong> an <span class="inline_code">Image</span> object in <span class="inline_code">setup()</span>. The main <span class="inline_code">draw()</span> will not be called until all <span class="inline_code">Image</span> objects in <span class="inline_code">setup()</span> are ready.</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">function setup(canvas) {
images = [];
images.push(new Image('http://www.clips.ua.ac.be/media/pattern_schema.gif'));
}
function draw(canvas) {
canvas.clear();
image(images[0], 0, 0);
}</pre></div>
<p>The <span class="inline_code">Image</span> object can be used to load an image from a <span class="inline_code">http://</span> location (<span class="inline_code">file://</span> will not work), a <span class="inline_code">data:</span> string, another <span class="inline_code">Image</span>, <span class="inline_code">Pixels</span>, an offscreen <span class="inline_code">Buffer</span> or a <span class="inline_code">Canvas</span>. Optionally, it will be rescaled to the given width and height. Note that for security reasons you cannot get <span class="inline_code">Pixels</span> of remote images (i.e., from a URL on another server).</p>
<pre class="brush:javascript; gutter:false; light:true;">var img = new Image(path, x=0, y=0, {width: null, height: null, alpha: 1.0});
</pre><pre class="brush:javascript; gutter:false; light:true;">img.x // Horizontal offset.
img.y // Vertical offset.
img.width // Image width in pixels.
img.height // Image height in pixels.
img.alpha // Image opacity (0.0-1.0).</pre><pre class="brush:javascript; gutter:false; light:true;">img.busy() // Still preloading? (true|false)</pre><pre class="brush:javascript; gutter:false; light:true;">img.copy()</pre><pre class="brush:javascript; gutter:false; light:true;">img.draw(x=0, y=0, {width: null, height: null, alpha: 1.0})</pre><h3>Image state functions</h3>
<p>The <span class="inline_code">image()</span> function draws an image to the screen. If optional parameters are given, they will take precedence over any property set in the given <span class="inline_code">Image</span>.</p>
<pre class="brush:javascript; gutter:false; light:true;">image(img, x, y, {width: null, height: null, alpha: 1.0})</pre><pre class="brush:javascript; gutter:false; light:true;">imagesize(img) // Returns a [width, height]-array.</pre><h3>Image pixels</h3>
<p>The <span class="inline_code">Pixels</span> object can be used to retrieve an array of R,G,B,A values (0-255) for each pixel in an image. Values can be modified, after which <span class="inline_code">Pixels.update()</span> must be called to reflect any changes to <span class="inline_code">Pixels.array</span>. The original image is not modified. A <span class="inline_code">Pixels</span> object can be passed to the <span class="inline_code">image()</span> function to draw it to the canvas.</p>
<pre class="brush:javascript; gutter:false; light:true;">var pixels = new Pixels(img);</pre><pre class="brush:javascript; gutter:false; light:true;">pixels.width // Image width in pixels.
pixels.height // Image height in pixels.
pixels.array // Array of width * height * 4 values (0-255).</pre><pre class="brush:javascript; gutter:false; light:true;">pixels.get(i) // Returns an [R,G,B,A]-array.
pixels.set(i, rgba)
pixels.map(callback)
pixels.update()
pixels.image()
pixels.copy()</pre><ul>
<li><span class="inline_code">Pixels.map()</span> applies a function to each pixel. Function takes (and returns) an <span class="inline_code">[R,G,B,A]</span>-array.</li>
<li><span class="inline_code">Pixels.get()</span> returns pixel <span class="inline_code">i</span> as an <span class="inline_code">[R,G,B,A]</span>-array with values between 0-255.</li>
<li><span class="inline_code">Pixels.set()</span> sets pixel <span class="inline_code">i</span> from an <span class="inline_code">[R,G,B,A]</span>-array.</li>
</ul>
<p>To iterate the pixels row by row:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">var p = new Pixels(img);
for (var i=0; i < p.height; i++) {
for (var j=0; j < p.width; j++) {
var rgba = p.get(i * p.width + j);
}
} </pre></div>
<h3>Image filters </h3>
<p>The <span class="inline_code">render()</span> function returns an <span class="inline_code">Image</span> from the drawing operations in the given callback function, i.e., a <em>procedural</em> image. This is useful for example to render a blur effect on a <span class="inline_code">BezierPath</span> or text. </p>
<p>The <span class="inline_code">filter()</span> function returns a new <span class="inline_code">Image</span> with the given callback function applied to each pixel. This function takes an <span class="inline_code">[R,G,B,A]</span>-array (base 255) and returns a new array. </p>
<p>The <span class="inline_code">polar()</span> function returns a new <span class="inline_code">Image</span> based on a polar coordinates filter (i.e., radial). The given callback is a <span class="inline_code">function(distance, angle)</span> that returns new <span class="inline_code">[distance,</span> <span class="inline_code">angle]</span>-array.</p>
<pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">render(callback, width, height)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">filter(img, callback)</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">polar(img, x0, y0, callback)</pre><p>A range of predefined filters is available, built on <span class="inline_code">Pixels</span>, <span class="inline_code">render()</span>, <span class="inline_code">filter()</span> and <span class="inline_code">polar()</span>. For example:<br /> </p>
<table border="0">
<tbody>
<tr>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-filter1.jpg" alt="" width="110" height="110" /></p>
<p class="small" style="text-align: center;">normal</p>
</td>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-filter2.jpg" alt="" width="110" height="110" /></p>
<p class="small" style="text-align: center;">bloom</p>
</td>
<td>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="../g/pattern-canvas-filter3.jpg" alt="" width="110" height="110" /></p>
<p class="small" style="text-align: center;">blur</p>
</td>
<td>
<p class="small" style="text-align: center;"><img src="../g/pattern-canvas-filter4.jpg" alt="" width="110" height="110" /></p>
<p class="small" style="text-align: center;">twirl</p>
</td>
</tr>
</tbody>
</table>
<p class="smallcaps">Generators</p>
<p>The <span class="inline_code">solid()</span> function returns an <span class="inline_code">Image</span> with a solid fill color.</p>
<pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">solid(width, height, clr)</pre><p class="smallcaps"> <br />Coloring</p>
<p>Coloring filters return a new <span class="inline_code">Image</span> with modified pixel values:</p>
<ul>
<li><span class="inline_code">invert()</span> swaps all the color channels (e.g., black becomes white).</li>
<li><span class="inline_code">colorize()</span> multiples the R,G,B,A channels with a color and adds bias.</li>
<li><span class="inline_code">adjust()</span> modifies the image brightness, contrast, and/or hue.</li>
<li><span class="inline_code">desaturate()</span> returns a grayscale image.</li>
<li><span class="inline_code">brightpass()</span> makes pixels whose luminance falls below the threshold black.</li>
<li><span class="inline_code">blur()</span> returns a blurred image, where radius defines the extent of the effect. <br />This uses the <a href="http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html" target="_blank">fast stack blur</a> algorithm.</li>
</ul>
<pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">invert(img)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">colorize(img, color=[1,1,1,1], bias=[0,0,0,0])</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">adjust(img, {hue: 0.0, saturation: 1.0, brightness: 1.0, contrast: 1.0})</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">desaturate(img)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">brightpass(img, threshold=0.5)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">blur(img, radius=10)</pre><p class="smallcaps"> <br />Alpha Compositing</p>
<p>Alpha compositing filters return a new Image that blend the pixels of two images. The <span class="inline_code">transparent()</span> function applies a solid alpha channel to the image. The <span class="inline_code">mask()</span> function applies <span class="inline_code">img2</span> as alpha channel to <span class="inline_code">img1</span>, where <span class="inline_code">img2</span> is a grayscale image (black areas = transparency).</p>
<pre class="wysiwyg-syntaxhl brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">transparent(img, alpha)</pre><pre class="wysiwyg-syntaxhl brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">mask(img1, img2, dx=0, dy=0, alpha=1.0)</pre><pre class="wysiwyg-syntaxhl brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">blend(mode, img1, img2, dx=0, dy=0, alpha=1.0)</pre><p>The <span class="inline_code">blend()</span> function mixes pixels using a set of formulas comparable to blend modes in Photoshop:</p>
<table class="border">
<tbody>
<tr>
<td class="smallcaps">Mode</td>
<td class="smallcaps">Effect</td>
</tr>
<tr>
<td class="inline_code">ADD</td>
<td>Pixels are added.</td>
</tr>
<tr>
<td class="inline_code">SUBTRACT</td>
<td>Pixels are subtracted.</td>
</tr>
<tr>
<td class="inline_code">LIGHTEN</td>
<td>Lightest value for each pixel.</td>
</tr>
<tr>
<td class="inline_code">DARKEN</td>
<td>Darkest value for each pixel.</td>
</tr>
<tr>
<td class="inline_code">MULTIPLY</td>
<td>Pixels are multiplied, resulting in a darker image.</td>
</tr>
<tr>
<td class="inline_code">SCREEN</td>
<td>Pixels are inverted, multiplied, inverted, resulting in a brighter image.</td>
</tr>
</tbody>
</table>
<p>The <span class="inline_code">dx</span> and <span class="inline_code">dy</span> parameters define the offset in pixels of <span class="inline_code">img2</span> from the top-left of <span class="inline_code">img1</span>. Each blend mode is also available as a separate function: <span class="inline_code">add()</span>, <span class="inline_code">subtract()</span> etc., with the same parameters except <span class="inline_code">mode</span>. </p>
<p class="smallcaps"> <br />Lighting</p>
<p>Lighting filters return a new <span class="inline_code">Image</span> with fringes of light around bright areas ("magic glow"). The <span class="inline_code">glow()</span> function uses a combination of <span class="inline_code">blur()</span> and <span class="inline_code">add()</span>. The <span class="inline_code">bloom()</span> function uses a combination of <span class="inline_code">brightpass()</span>, <span class="inline_code">blur()</span> and <span class="inline_code">glow()</span>. The <span class="inline_code">radius</span> defines the extent of the blur. Pixels whose luminance falls below the <span class="inline_code">threshold</span> produce no glow. </p>
<pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">glow(img, intensity=0.5, radius=10)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">bloom(img, intensity=0.5, radius=10, threshold=0.3)</pre><p> <br /><span class="smallcaps">Distortion</span></p>
<p>Distortion filters return a new <span class="inline_code">Image</span> based on a polar coordinates operation. The <span class="inline_code">bump()</span> function bulges the image outward, <span class="inline_code">dent()</span> squeezes the image inward, and <span class="inline_code">pinch()</span> does both. The <span class="inline_code">splash()</span> function produces a light-tunnel effect, while <span class="inline_code">twirl()</span> produces a spinning effect. The <span class="inline_code">radius</span> defines the extent of the effect in pixels. The <span class="inline_code">zoom</span> defines the depth of the effect (<span class="inline_code">0.0</span>–<span class="inline_code">1.0</span> for bump and dent, and <span class="inline_code">-1.0</span>–<span class="inline_code">1.0</span> for pinch). The <span class="inline_code">angle</span> is the amount of degrees to rotate.</p>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">bump(img, dx, dy, radius, zoom)</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">dent(img, dx, dy, radius, zoom)</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">pinch(img, dx, dy, zoom)</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">splash(img, dx, dy, radius)</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">twirl(img, dx, dy, radius, angle)</pre><p>The <span class="inline_code">dx</span> and <span class="inline_code">dy</span> parameters define the offset of the effect from the image center, in pixels.</p>
<p> </p>
<hr />
<h2><a name="text"></a>Text</h2>
<p>The <span class="inline_code">text()</span> function can be used to draw a string of text to the canvas. The <span class="inline_code">font()</span>, <span class="inline_code">fontsize()</span>, <span class="inline_code">fontweight()</span> and <span class="inline_code">lineheight()</span> functions set the current text state. Each function also returns its current setting. The default font is 12px normal sans-serif with 1.2em line height.</p>
<pre class="brush:javascript; gutter:false; light:true;">font(fontname)</pre><pre class="brush:javascript; gutter:false; light:true;">fontsize(fontsize)</pre><pre class="brush:javascript; gutter:false; light:true;">fontweight(fontweight) // NORMAL, BOLD, ITALIC, BOLD+ITALIC</pre><pre class="brush:javascript; gutter:false; light:true;">lineheight(lineheight)</pre><p>The <span class="inline_code">text()</span> function draws a string using the current color, transformation and text state:</p>
<pre class="brush:javascript; gutter:false; light:true;">text(str, x, y)</pre><pre class="brush:javascript; gutter:false; light:true;">textwidth(str)</pre><pre class="brush:javascript; gutter:false; light:true;">textheight(str)</pre><p>The state can be overridden by passing an optional <span class="inline_code">font</span>, <span class="inline_code">fontsize</span>, <span class="inline_code">fontweight</span>, <span class="inline_code">lineheight</span> and/or <span class="inline_code">fill</span> to the functions:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">text("Hello world", 0, 0, {
fill: new Color(1,0,0),
font: "Georgia",
fontweight: BOLD
});</pre></div>
<p> </p>
<hr />
<h2><a name="mouse"></a>Mouse & keyboard</h2>
<p>The <span class="inline_code">Mouse</span> object stores the current state of the mouse input device (or touch event). It can be retrieved with the <span class="inline_code">canvas.mouse</span> property in the main <span class="inline_code">draw()</span> loop.</p>
<pre class="brush:javascript; gutter:false; light:true;">var mouse = canvas.mouse;</pre><pre class="brush:javascript; gutter:false; light:true;">var mouse = new Mouse(element);</pre><pre class="brush:javascript; gutter:false; light:true;">mouse.parent // Element to track.
mouse.x // Horizontal position.
mouse.y // Vertical position.
mouse.relative_x // Relative (0.0-1.0) to Canvas.width.
mouse.relative_y // Relative (0.0-1.0) to Canvas.height.
mouse.pressed // Mouse is pressed? (true|false)
mouse.dragged // Mouse is dragged? (true|false)
mouse.drag.x // Drag distance from previous x.
mouse.drag.y // Drag distance from previous y.</pre><pre class="brush:javascript; gutter:false; light:true;">mouse.cursor(mode) // DEFAULT, CROSS, HAND, HIDDEN, TEXT, WAIT</pre><pre class="brush:javascript; gutter:false; light:true;">mouse.onmove()
mouse.onpress()
mouse.onrelease()
mouse.ondrag()</pre><p>Custom event handlers can be attached to <span class="inline_code">Mouse</span>. The function takes a parameter <span class="inline_code">mouse</span>, which is the <span class="inline_code">Mouse</span> receiving the event. The canvas can be accessed with <span class="inline_code">mouse.parent.canvas</span>. To draw to this canvas during the event, first call its <span class="inline_code">focus()</span> method.</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">function setup(canvas) {
canvas.mouse.ondrag = function(mouse) {
mouse.parent.canvas.focus();
ellipse(mouse.x, mouse.y, 2, 2);
};
} </pre></div>
<p> </p>
<hr />
<h2><a name="canvas"></a>Canvas</h2>
<p>The <span class="inline_code">Canvas</span> object manages the animation container. With <span class="inline_code"><script type="text/canvas"></span>, there is no explicit need to initialize a new canvas in your script. It will be created for you and passed as a parameter <span class="inline_code">canvas</span> to the <span class="inline_code">draw()</span> and <span class="inline_code">setup()</span> functions in your script:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;"><!doctype html>
<html>
<head>
<script type="text/javascript" src="canvas.js"></script>
</head>
<body>
<script type="text/canvas" loop="true">
function setup(canvas) {
canvas.size(500, 500);
}
function draw(canvas) {
canvas.clear();
// Add drawing code here.
}
</script>
</body>
</html></pre></div>
<p>Custom animations require a HTML <span class="inline_code"><canvas></span> element and a <span class="inline_code">window.onload()</span> that binds the element to a <span class="inline_code">Canvas</span> object and assigns a <span class="inline_code">draw()</span> and a <span class="inline_code">setup()</span> function to the canvas:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;"><!doctype html>
<html>
<head>
<script type="text/javascript" src="canvas.js"></script>
<script>
function setup(canvas) {
canvas.size(500, 500);
}
function draw(canvas) {
canvas.clear();
// Add drawing code here.
}
window.onload = function() {
canvas = new Canvas(document.getElementById("canvas1"));
canvas.setup = setup;
canvas.draw = draw;
canvas.run();
}
</script>
</head>
<body>
<canvas id="canvas1" width="500px" height="500px"></canvas>
</body>
</html></pre></div>
<p>The <span class="inline_code">Canvas</span> object takes a <span class="inline_code"><canvas></span> element:</p>
<pre class="brush:javascript; gutter:false; light:true;">var canvas = new Canvas(element);</pre><pre class="brush:javascript; gutter:false; light:true;">canvas.id
canvas.element // HTML <canvas> element.
canvas.width // Element width.
canvas.height // Element height.
canvas.frame // Current animation frame (start = 1).
canvas.fps // Frames per second (read-only).
canvas.dt // Time elapsed since last frame.
canvas.mouse // Mouse object.
canvas.variables // Widget variables.</pre><pre class="brush:javascript; gutter:false; light:true;">canvas.size(width, height)</pre><pre class="brush:javascript; gutter:false; light:true;">canvas.setup()
canvas.draw()
canvas.clear()
canvas.run()
canvas.pause()
canvas.stop()
canvas.active() // Returns true if the animation is running.
canvas.focus() // Sets the canvas as current drawing context. </pre><pre class="brush:javascript; gutter:false; light:true;">canvas.image() // Returns the canvas as an Image.
canvas.save() // Returns the canvas as PNG data.</pre><ul>
<li><span class="inline_code">Canvas.setup()</span> is meant to be overridden. It runs once at the start of the animation.</li>
<li><span class="inline_code">Canvas.draw()</span> is meant be overridden. It runs each frame.</li>
<li><span class="inline_code">Canvas.save()</span> and <span class="inline_code">Canvas.image()</span> will throw an error if the canvas contains remote images<br />(i.e., from a URL on a different server). This is for security reasons, see <span class="link-maintenance"><a href="https://developer.mozilla.org/en/CORS_Enabled_Image" target="_blank">CORS</a></span>. </li>
</ul>
<p> </p>
<hr />
<h2><a name="widget"></a>Widgets</h2>
<p>Widgets (e.g., buttons, sliders) give you the possibility to create apps that users can interact with without diving into the JavaScript code. The <span class="inline_code">widget()</span> function creates a widget linked to the given <span class="inline_code">Canvas</span>. The value of the widget can be retrieved as <span class="inline_code">Canvas.variables[variable]</span>. The <span class="inline_code">type</span> can be <span class="inline_code">STRING</span> or <span class="inline_code">NUMBER</span> (a field), <span class="inline_code">BOOLEAN</span> (a checkbox), <span class="inline_code">RANGE</span> (a slider), <span class="inline_code">LIST</span> (a dropdown list) or <span class="inline_code">FUNCTION</span> (a button).</p>
<p>Optionally, a default <span class="inline_code">value</span> can be given. For lists, this is an <span class="inline_code">Array</span>, the <span class="inline_code">index</span> of the selected value is 0 by default. For sliders, you can also set <span class="inline_code">min</span>, <span class="inline_code">max</span> and <span class="inline_code">step</span>. For functions, a <span class="inline_code">callback(event)</span> must be given. To get the canvas in the callback function, use <span class="inline_code">event.target.canvas</span>. If the function does drawing, call <span class="inline_code">event.target.canvas.focus()</span> first.</p>
<p>The <span class="inline_code">widget()</span> function will generate a <span class="inline_code"><div id="[canvas.id]_widgets" class="widgets"></span>, if it does not yet exist. The <span class="inline_code"><div></span> is added to the page below the canvas. Optionally, a different <span class="inline_code">parent</span> HTML element can be given. The parent contains all canvas widgets, each wrapped in a <span class="inline_code"><span class="widget"></span>.</p>
<pre class="brush:javascript; gutter:false; light:true;">widget(canvas, variable, type, {
parent: null,
value: null,
min: 0,
max: 1,
step: 0.01,
index: 0,
callback: function(event) { }
})</pre><p>For example, the following script comes with buttons to start and pause the animation:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">function setup(canvas) {
widget(canvas, "start", FUNCTION, {callback: function(e) {
e.target.canvas.run();
}});
widget(canvas, "pause", FUNCTION, {callback: function(e) {
e.target.canvas.pause();
}});
}
function draw(canvas) {
canvas.clear();
translate(200, 200);
rotate(canvas.frame);
rect(-75, -75, 150, 150);
}</pre></div>
<div class="example"> </div>
<hr />
<h2 class="example"><a name="json"></a>JSON</h2>
<div class="example">The easiest way to incorporate data sets in an animation is by using <a href="http://www.json.org/" target="_blank">JSON</a>, a lightweight data-interchange format based on associative arrays (i.e., like a <span class="inline_code">dict</span> in Python). For example, you can use the <span class="inline_code">Datasheet</span> object in <a href="pattern.db.html">pattern.db</a> to generate JSON from Python:</div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> from pattern.db import Datasheet, STRING, INTEGER
>>> ds = Datasheet(fields=[('name', STRING), ('count', INTEGER)])
>>> ds.append(( 'chickens', 12))
>>> ds.append(( 'penguins', 26))
>>> ds.append(('sombreros', 9))
>>> open('data.js', 'w').write('var data = ' + ds.json + ';')</pre></div>
<p>This generates a <span class="inline_code">data.js</span> file that defines a <span class="inline_code">data</span> variable:</p>
<div class="example">
<pre class="brush:javascript; gutter:false; light:true;">var data = [
{'name': 'chickens', 'count': 12},
{'name': 'penguins', 'count': 26},
{'name': 'sombreros', 'count': 9}
];</pre></div>
<p>We can load <span class="inline_code">data.js</span> in the HTML <span class="inline_code"><head></span> section so <span class="inline_code">data</span> becomes available in the animation:</p>
<div class="example">
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; "><html>
<head>
<script type="text/javascript" src="canvas.js"></script>
<script type="text/javascript" src="data.js"></script>
</head>
<body>
<script type="text/canvas">
function draw(canvas) {
// Draw the data as a bar chart.
var dx = 10;
var dy = 10;
for (var i=0; i < data.length; i++) {
rect(dx, dy, data[i]['count'] * 10, 30);
text(data[i]['name'], dx+10, dy+20, {fill:1}); dy += 40;
}
}
</script>
</body>
</html></pre></div>
<p> </p>
<hr />
<h2><a name="geometry"></a>Geometry</h2>
<p>The <span class="inline_code">Point</span> object can be used to represent (x, y) coordinates in 2D space:</p>
<pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">var pt = new Point(x, y);</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">pt.x
pt.y </pre><p>The module includes the following helper functions for 2D geometry: </p>
<pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.angle(x0, y0, x1, y1) // Returns the angle between two points.</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.distance(x0, y0, x1, y1) // Returns the distance between two points.</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.coordinates(x0, y0, d, a) // Returns Point at distance d with angle a.</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.rotate(x, y, x0, y0, a) // Returns Point (x,y) rotated around (x0,y0).</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.lerp(a, b, t) // Linear interpolation: lerp(4, 8, 0.5) => 6</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.smoothstep(a, b, x) // Hermite interpolation (ease-in + ease-out).</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.lineIntesection(x0, y0, x1, y1, x2, y2, x3, y3, infinite=false)</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">geometry.pointInPolygon(points, x, y)</pre><p style="margin-top: 0.2em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px;">In addition to the standard math functions such as <span class="inline_code">Math.sin()</span>, <span class="inline_code">Math.cos()</span> and <span class="inline_code">Math.sqrt()</span>, the module defines the following math functions:</p>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Math.sign(x) // Returns +1, -1 or 0 for a given number.</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">Math.degrees(radians) // Math.degrees(Math.PI) => 180</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">Math.radians(degrees) // Math.radians(180) => Math.PI</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">Math.clamp(value, min, max) // Math.clamp(1.5, 0.0, 1.0) => 1.0</pre><pre class="wysiwyg-syntaxhl brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; " style="color: #555555 !important; font-family: Courier, 'Courier New', monospace !important; font-size: 12px !important; margin-top: 0.7em !important; margin-right: 0px !important; margin-bottom: 0.7em !important; margin-left: 0px !important; line-height: 1.3em !important; padding-top: 0.2em !important; padding-right: 0.4em !important; padding-bottom: 0.2em !important; padding-left: 0.4em !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #dcebfa !important; border-top-left-radius: 0.5em 0.5em; border-top-right-radius: 0.5em 0.5em; border-bottom-right-radius: 0.5em 0.5em; border-bottom-left-radius: 0.5em 0.5em; font: normal normal normal 10px/normal Monaco, monospace, 'Courier New', Courier; background-position: initial initial !important; background-repeat: initial initial !important; border-width: 1px !important; border-color: #c8d7e6 !important; border-style: solid !important;">Math.dot(array1, array2) // a1[0] * a2[0] + a1[1] * a2[1] + ... </pre><p> </p>
<hr />
<h2><a name="array"></a>Arrays</h2>
<p>An <span class="inline_code">Array</span> can be used to store a list of values (e.g., numbers and/or strings):</p>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">var a = [1, 2, 3];</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">a[index] // [1,2,3][0] => 1
a.indexOf(value) // [1,2,3].indexOf(1) => 0
a.push(value) // [1,2,3].push(4) => [1,2,3,4]
a.pop() // [1,2,3].pop() => [1,2] 3
a.shift() // [1,2,3].shift() => 1 [2,3]
a.concat(array) // [1,2,3].concact([4,5]) => [1,2,3,4,5] copy
a.slice(i, j=null) // [1,2,3].slice(1,3) => [2,3]
a.splice(i, n, v1, v2, ...) // [1,2,3].splice(1,0,11,12) => [1,11,12,2,3]
a.join(str) // [1,2,3].join(",") => "1,2,3" </pre><p>The module defines the following helper functions for arrays:</p>
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.instanceof(array) // Returns true if object is an Array.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.min(array) // Returns the smallest value.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.max(array) // Returns the largest value.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.sum(array) // Returns the sum of all values.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.contains(array, value) // Returns true if array contains value.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.find(array, match) // Returns first value with match(value) == true.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.map(array, callback) // Returns new array of callback(value) values.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.filter(array, callback) // Returns new array for callback(value) == true.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.enumerate(array, callback) // Calls callback(index, value) for each value.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.eq(array1, array2) // Returns true if values array1 == array2.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.sorted(array, reverse=false) // Returns a new array with sorted values. </pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.reversed(array) // Returns a new array with reversed order. </pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.choice(array) // Returns a random value.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.shuffle(array) // Randomly shuffles the values in the array.</pre><pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">Array.range(i, j) // Returns an array with values i => j-1.</pre><div class="example">
<pre class="brush: jscript;gutter: false; light: true; fontsize: 100; first-line: 1; ">var a = [0, 1, 2, 3, 4, 5];
a = Array.map(a, function(v) { return v * 2; }); // {0, 2, 3, 6, 8, 10}
a = Array.filter(a, function(v) { return v < 5 }); // [0, 2, 4]</pre></div>
<p> </p>
<hr />
<h2>See also</h2>
<ul>
<li><a href="http://processingjs.org/" target="_blank">processing.js</a></li>
<li><a href="http://paperjs.org/" target="_blank">paper.js</a></li>
</ul>
</div>
</div></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
SyntaxHighlighter.all();
</script>
</body>
</html>
================================================
FILE: docs/html/pattern-db.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>pattern-db</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../clips.css" />
<style>
/* Small fixes because we omit the online layout.css. */
h3 { line-height: 1.3em; }
#page { margin-left: auto; margin-right: auto; }
#header, #header-inner { height: 175px; }
#header { border-bottom: 1px solid #C6D4DD; }
table { border-collapse: collapse; }
#checksum { display: none; }
</style>
<link href="../js/shCore.css" rel="stylesheet" type="text/css" />
<link href="../js/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/shCore.js"></script>
<script language="javascript" src="../js/shBrushXml.js"></script>
<script language="javascript" src="../js/shBrushJScript.js"></script>
<script language="javascript" src="../js/shBrushPython.js"></script>
</head>
<body class="node-type-page one-sidebar sidebar-right section-pages">
<div id="page">
<div id="page-inner">
<div id="header"><div id="header-inner"></div></div>
<div id="content">
<div id="content-inner">
<div class="node node-type-page"
<div class="node-inner">
<div class="breadcrumb">View online at: <a href="http://www.clips.ua.ac.be/pages/pattern-db" class="noexternal" target="_blank">http://www.clips.ua.ac.be/pages/pattern-db</a></div>
<h1>pattern.db</h1>
<!-- Parsed from the online documentation. -->
<div id="node-1432" class="node node-type-page"><div class="node-inner">
<div class="content">
<p class="big">The pattern.db module contains wrappers for databases (SQLite, MySQL), Unicode CSV files and Python's datetime. It offers a convenient way to work with tabular data, for example retrieved with the pattern.web module.</p>
<p>It can be used by itself or with other <a href="pattern.html">pattern</a> modules: <a href="pattern-web.html">web</a> | db | <a href="pattern-en.html">en</a> | <a href="pattern-search.html">search</a> <span class="blue"></span> | <a href="pattern-vector.html">vector</a> | <a href="pattern-graph.html">graph</a>.</p>
<p><img src="../g/pattern_schema.gif" alt="" width="620" height="180" /></p>
<hr />
<h2>Documentation</h2>
<ul style="margin-top: 0;">
<li><a href="#database">Database</a> <span class="smallcaps link-maintenance">(sqlite + mysql)</span></li>
<li><a href="#table">Table</a></li>
<li><a href="#query">Query</a></li>
<li><a href="#datasheet">Datasheet</a> <span class="smallcaps link-maintenance">(<a href="#csv">csv</a>)</span></li>
<li><a href="#date">Date</a></li>
</ul>
<p> </p>
<hr />
<h2><a name="database"></a>Database</h2>
<p>A database is a collection of tables. A table has rows of data with a specific data type (e.g., string, float) for each field or column. A database engine provides an interface to the database, using <a href="https://en.wikipedia.org/wiki/SQL" target="_blank">SQL</a> statements (Structured Query Language). Python 2.5+ comes bundled with the SQLite engine. The <a href="http://www.mysql.com/" target="_blank">MySQL</a> engine requires the <a href="http://sourceforge.net/projects/mysql-python/" target="_blank">MySQL-Python</a> bindings. Note that a 32-bit Python requires a 32-bit MySQL.</p>
<p>The <span class="inline_code">Database()</span> constructor creates (if necessary) and returns an <span class="inline_code">SQLITE</span> or <span class="inline_code">MYSQL</span> database. With <span class="inline_code">SQLITE</span>, it will create a file with the given name in the current folder.</p>
<pre class="brush:python; gutter:false; light:true;">db = Database(
name,
host = 'localhost',
port = 3306,
username = 'root',
password = '',
type = SQLITE
)
</pre><pre class="brush:python; gutter:false; light:true;">db.type # SQLITE | MYSQL
db.name # Database name.
db.host # Database host (MySQL).
db.port # Database port (MySQL).
db.username # Database username (MySQL).
db.password # Database password (MySQL).
db.tables # Dictionary of (name, Table)-items.
db.relations # List of relations, see Database.link().
db.query # Last executed SQL query.
db.connected # True after Database.connect(). </pre><pre class="brush:python; gutter:false; light:true;">db.connect() # Happens automatically.
db.disconnect()</pre><pre class="brush:python; gutter:false; light:true;">db.create(table, fields=[])
db.remove(table)
db.link(table1, field1, table2, field2, join=LEFT) </pre><pre class="brush:python; gutter:false; light:true;">db.execute(SQL, commit=False)
db.commit()
db.escape(value) # "a cat's tail" => "'a cat\'s tail'"</pre><ul>
<li><span class="inline_code">Database.execute()</span> returns an iterator of rows for the given SQL query.</li>
<li><span class="inline_code">Database.commit()</span> commits the changes of pending <span class="inline_code">INSERT</span>, <span class="inline_code">UPDATE</span>, <span class="inline_code">DELETE</span> queries.</li>
<li><span class="inline_code">Database.escape()</span> safely quotes and escapes field values.</li>
</ul>
<h3>Create table</h3>
<p><span class="inline_code">Database.create()</span> creates a new table in the database, It takes a table name and a list of row fields, where each field is defined with the <span class="inline_code">field()</span> function. Each field has a <span class="inline_code">name</span> (a-z + underscores) and a <span class="inline_code">type</span>, with an optional <span class="inline_code">default</span> value for new rows. The <span class="inline_code">pk()</span> function can be used for primary keys.</p>
<pre class="brush:python; gutter:false; light:true;">field(name, type=STRING, default=None, index=False, optional=True)</pre><pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">pk(name='id') # field('id', INTEGER, index=PRIMARY, optional=False) </pre><table class="border">
<tbody>
<tr>
<td><span class="smallcaps">Type</span></td>
<td><span class="smallcaps">Value</span></td>
<td><span class="smallcaps">Example</span></td>
</tr>
<tr>
<td><span class="inline_code">STRING</span></td>
<td><span class="inline_code">str</span>, <span class="inline_code">unicode</span> (1-255 characters)</td>
<td><span class="inline_code">u'Schrödinger'</span></td>
</tr>
<tr>
<td><span class="inline_code">INTEGER</span></td>
<td><span class="inline_code">int</span></td>
<td><span class="inline_code">42</span></td>
</tr>
<tr>
<td><span class="inline_code">FLOAT</span></td>
<td><span class="inline_code">float</span></td>
<td><span class="inline_code">3.14159</span></td>
</tr>
<tr>
<td><span class="inline_code">TEXT</span></td>
<td><span class="inline_code">str</span>, <span class="inline_code">unicode</span></td>
<td><span class="inline_code">open('file.txt').read() </span></td>
</tr>
<tr>
<td><span class="inline_code">BLOB</span></td>
<td><span class="inline_code">str</span> (binary, e.g., PDF, PNG)</td>
<td><span class="inline_code">db.binary(open('img.jpg',</span> <span class="inline_code">'rb').read())</span></td>
</tr>
<tr>
<td><span class="inline_code">BOOLEAN</span></td>
<td><span class="inline_code">bool</span></td>
<td><span class="inline_code">True</span>, <span class="inline_code">False</span></td>
</tr>
<tr>
<td><span class="inline_code">DATE</span></td>
<td><span class="inline_code">Date</span></td>
<td><span class="inline_code">date('1999-12-31 23:59:59')</span></td>
</tr>
</tbody>
</table>
<p>A <span class="inline_code">STRING</span> field can contain up to a 100 characters. The length (1-255) can be changed by calling <span class="inline_code">STRING</span> as a function, e.g., <span class="inline_code">type=STRING(255)</span>. For longer strings, use <span class="inline_code">TEXT</span>. The default value for a <span class="inline_code">DATE</span> field is <span class="inline_code">NOW</span>.</p>
<p>With <span class="inline_code">index=True</span>, the field is indexed for faster search. The index can also be set to <span class="inline_code">UNIQUE</span> (no duplicates) or <span class="inline_code">PRIMARY</span>. A table must have a primary key field that uniquely identifies each row (i.e., an id). Integer primary keys are auto-numbered, there is no need to set the value manually in new rows.</p>
<p>With <span class="inline_code">optional=True</span>, the field is allowed to contain <span class="inline_code">None</span>.</p>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> from pattern.db import Database, field, pk, STRING, BOOLEAN, DATE, NOW
>>>
>>> db = Database('my_stuff')
>>> db.create('pets', fields=(
>>> pk(),
>>> field('name', STRING(80), index=True),
>>> field('type', STRING(20)),
>>> field('tail', BOOLEAN),
>>> field('date_birth', DATE, default=None),
>>> field('date_created', DATE, default=NOW)
>>> ))</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.append(name=u'Schrödinger', type='cat', tail=True)
>>> print db.pets.rows()[0]
(1, u'Schrödinger', u'cat', True, None, Date('2013-12-11 10:09:08'))</pre></div>
<h3>Create table from XML</h3>
<p><span class="inline_code">Database.create()</span> can also take a <span class="inline_code">Table.xml</span> or <span class="inline_code">Query.xml</span>. It creates a new table and copies the row data in the given XML string. An optional <span class="inline_code">name</span> parameter can be used to rename the new table. In <span class="inline_code">Query.xml</span>, a field name may contain a period. It will be replaced with an underscore (e.g., pets.name → pets_name). Alternatively, an alias can be defined in the <span class="inline_code">Query.aliases</span> dictionary.</p>
<p> </p>
<hr />
<h2><a name="table"></a>Table</h2>
<p>A <span class="inline_code">Table</span> is a list of rows, with one or more fields (i.e., table columns) of a certain type (i.e., string or number). A new table can be created with <span class="inline_code">Database.create()</span>. A <span class="inline_code">TableError</span> is raised if a table with the given name exists. An existing table can be retrieved with <span class="inline_code">Database.tables[name]</span>, <span class="inline_code">Database[name]</span> or <span class="inline_code">Database.<name></span>.</p>
<pre class="brush:python; gutter:false; light:true;">table = Database.tables[name]</pre><pre class="brush:python; gutter:false; light:true;">table.db # Parent Database.
table.name # Table name (a-z + underscores).
table.fields # List of field names (i.e., columns).
table.schema # Dictionary of (field, Schema)-items.
table.default # Dictionary of (field, value)-items for new rows.
table.pk # Primary key field name.</pre><pre class="brush:python; gutter:false; light:true;">table.count() # Total number of rows (len(table) also works).
table.rows() # List of rows, each a tuple of fields.
</pre><pre class="brush:python; gutter:false; light:true;">table.record(row) # Dictionary of (field, value)-items for given row.</pre><pre class="brush:python; gutter:false; light:true;">table.append(fields={}, commit=True)
table.update(id, fields={}, commit=True)
table.remove(id, commit=True)
</pre><pre class="brush:python; gutter:false; light:true;">table.filter(*args, **kwargs)
table.search(*args, **kwargs) </pre><pre class="brush:python; gutter:false; light:true;">table.xml # XML string with the table schema and rows.
table.datasheet # Datasheet object (see below).</pre><ul>
<li><span class="inline_code">Table.rows()</span> returns a list of all rows. To iterate rows memory-efficiently, use <span class="inline_code">iter(</span><span class="inline_code">Table)</span>.</li>
<li><span class="inline_code">Table.append()</span>, <span class="inline_code">update()</span> and <span class="inline_code">remove()</span> modify the table contents.<br />With <span class="inline_code">commit=False</span>, changes are only committed after <span class="inline_code">Database.commit()</span> (= faster in batch).</li>
<li><span class="inline_code">Table.filter()</span> returns a subset of rows with a subset of fields.<br />For example: <span class="inline_code">table.filter('name',</span> <span class="inline_code">type='cat')</span>.</li>
</ul>
<h3>Table schema</h3>
<p>The <span class="inline_code">Table.schema</span> dictionary contains field name → <span class="inline_code">Schema</span> items.</p>
<pre class="brush:python; gutter:false; light:true;">schema = Table.schema[fieldname]</pre><pre class="brush:python; gutter:false; light:true;">schema.name # Field name.
schema.type # STRING, INTEGER, FLOAT, TEXT, BLOB, BOOLEAN, DATE
schema.length # STRING field length.
schema.default # Default value.
schema.index # PRIMARY | UNIQUE | True | False
schema.optional # True or False. </pre><div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> from pattern.db import Database
>>>
>>> db = Database('my_stuff')
>>>
>>> print db.pets.fields
>>> print db.pets.schema['name'].type
>>> print db.pets.schema['name'].length
['id', 'name', 'tail', 'date_birth', 'date_created']
STRING
80 </pre></div>
<h3>Append row</h3>
<p><span class="inline_code">Table.append()</span> adds a new row with the given field values. It returns the row id, if the table has a primary key generated with <span class="inline_code">pk()</span>. Field values can be given as optional parameters, a dictionary or a tuple. Field values for a <span class="inline_code">BLOB</span> field must be wrapped in <span class="inline_code">Database.binary()</span>.<span style="color: #333333; font-family: Inconsolata, 'Courier New', Courier, monospace; font-size: small;"></span></p>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.append(name=u'Schrödinger', date_birth=date('2009-08-12'))</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.append({'name': u'Schrödinger', 'date_birth': date('2009-08-12')}) </pre></div>
<div class="example">
<pre class="brush: python;gutter: false; light: true; fontsize: 100; first-line: 1; ">>>> db.pets.append((u'Schrödinger', 'cat', True, date('2009-08-12')) # in-order</pre></div>
<h3>Update row</h3>
<p><span class="inline_code">Table.update()</span> updates values in the row with the given primary key. A batch of rows can be updated using a <a class="link-maintenance" href="#filter">filter</a>, or a chain of filters with <span class="inline_code">any()</span> or <span class="inline_code">all()</span>. In the last example, all rows with <span class="inline_code">type='cat'</span> will have their <span class="inline_code">tail</span> field set to <span class="inline_code">True</span>.</p>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.update(1, type='cat') # set type='cat' in row with id=1.</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.update(1, {'type': 'cat'})</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.update(eq('type', 'cat'), tail=True) </pre></div>
<h3>Remove row</h3>
<p><span class="inline_code">Table.remove()</span> removes the row with the given primary key:</p>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.remove(1)</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.remove(ALL)</pre></div>
<div class="example">
<pre class="brush:python; gutter:false; light:true;">>>> db.pets.remove(all(eq('type', 'cat'), lt(year('date_birth'), 1990, '<')))</pre></div>
<p>The last exampl
gitextract_3rltpp20/
├── .gitignore
├── .pylintrc
├── .travis.yml
├── LICENSE.txt
├── README.md
├── __init__.py
├── docs/
│ ├── clips.css
│ ├── html/
│ │ ├── mbsp-tags.html
│ │ ├── pattern-canvas.html
│ │ ├── pattern-db.html
│ │ ├── pattern-de.html
│ │ ├── pattern-dev.html
│ │ ├── pattern-en.html
│ │ ├── pattern-es.html
│ │ ├── pattern-fr.html
│ │ ├── pattern-graph.html
│ │ ├── pattern-it.html
│ │ ├── pattern-metrics.html
│ │ ├── pattern-nl.html
│ │ ├── pattern-search.html
│ │ ├── pattern-shell.html
│ │ ├── pattern-vector.html
│ │ ├── pattern-web.html
│ │ ├── pattern.html
│ │ └── stop-words.html
│ ├── index.html
│ ├── js/
│ │ ├── shBrushJScript.js
│ │ ├── shBrushPython.js
│ │ ├── shBrushXml.js
│ │ ├── shCore.css
│ │ ├── shCore.js
│ │ └── shThemeDefault.css
│ └── update.py
├── examples/
│ ├── 01-web/
│ │ ├── 01-google.py
│ │ ├── 02-google-translate.py
│ │ ├── 03-bing.py
│ │ ├── 04-twitter.py
│ │ ├── 05-twitter-stream.py
│ │ ├── 06-feed.py
│ │ ├── 07-wikipedia.py
│ │ ├── 08-wiktionary.py
│ │ ├── 09-wikia.py
│ │ ├── 10-dbpedia.py
│ │ ├── 11-facebook.py
│ │ ├── 12-dom.py
│ │ ├── 13-crawler.py
│ │ ├── 14-flickr.py
│ │ └── 15-sort.py
│ ├── 02-db/
│ │ ├── 01-database.py
│ │ ├── 02-datasheet.py
│ │ ├── 03-date.py
│ │ └── food.txt
│ ├── 03-en/
│ │ ├── 01-inflect.py
│ │ ├── 02-quantify.py
│ │ ├── 03-parse.py
│ │ ├── 04-tree.py
│ │ ├── 05-tagset.py
│ │ ├── 06-wordnet.py
│ │ ├── 07-sentiment.py
│ │ ├── 08-topmine_ngrammer.py
│ │ └── texts/
│ │ ├── 1701.00002.txt
│ │ ├── 1701.00003.txt
│ │ ├── 1701.00004.txt
│ │ ├── 1701.00005.txt
│ │ ├── 1701.00006.txt
│ │ ├── 1701.00007.txt
│ │ ├── 1701.00008.txt
│ │ ├── 1701.00009.txt
│ │ ├── 1701.00010.txt
│ │ ├── 1701.00011.txt
│ │ ├── 1701.00012.txt
│ │ ├── 1701.00013.txt
│ │ ├── 1701.00014.txt
│ │ ├── 1701.00015.txt
│ │ ├── 1701.00016.txt
│ │ ├── 1701.00017.txt
│ │ ├── 1701.00018.txt
│ │ ├── 1701.00019.txt
│ │ ├── 1701.00020.txt
│ │ ├── 1701.00021.txt
│ │ ├── 1701.00022.txt
│ │ ├── 1701.00023.txt
│ │ ├── 1701.00024.txt
│ │ ├── 1701.00025.txt
│ │ ├── 1701.00026.txt
│ │ ├── 1701.00027.txt
│ │ ├── 1701.00028.txt
│ │ ├── 1701.00029.txt
│ │ ├── 1701.00030.txt
│ │ ├── 1701.00031.txt
│ │ ├── 1701.00032.txt
│ │ ├── 1701.00033.txt
│ │ ├── 1701.00034.txt
│ │ ├── 1701.00035.txt
│ │ ├── 1701.00037.txt
│ │ ├── 1701.00038.txt
│ │ ├── 1701.00039.txt
│ │ ├── 1701.00043.txt
│ │ ├── 1701.00044.txt
│ │ ├── 1701.00045.txt
│ │ ├── 1701.00046.txt
│ │ ├── 1701.00047.txt
│ │ ├── 1701.00049.txt
│ │ ├── 1701.00050.txt
│ │ ├── 1701.00051.txt
│ │ ├── 1701.00052.txt
│ │ ├── 1701.00053.txt
│ │ ├── 1701.00054.txt
│ │ ├── 1701.00055.txt
│ │ ├── 1701.00056.txt
│ │ ├── 1701.00057.txt
│ │ ├── 1701.00058.txt
│ │ ├── 1701.00060.txt
│ │ ├── 1701.00061.txt
│ │ ├── 1701.00062.txt
│ │ ├── 1701.00063.txt
│ │ ├── 1701.00064.txt
│ │ ├── 1701.00065.txt
│ │ ├── 1701.00066.txt
│ │ ├── 1701.00067.txt
│ │ ├── 1701.00068.txt
│ │ ├── 1701.00069.txt
│ │ ├── 1701.00072.txt
│ │ ├── 1701.00073.txt
│ │ ├── 1701.00074.txt
│ │ ├── 1701.00075.txt
│ │ ├── 1701.00076.txt
│ │ ├── 1701.00077.txt
│ │ ├── 1701.00078.txt
│ │ ├── 1701.00079.txt
│ │ ├── 1701.00081.txt
│ │ ├── 1701.00082.txt
│ │ ├── 1701.00083.txt
│ │ ├── 1701.00084.txt
│ │ ├── 1701.00085.txt
│ │ ├── 1701.00086.txt
│ │ ├── 1701.00087.txt
│ │ ├── 1701.00088.txt
│ │ ├── 1701.00089.txt
│ │ ├── 1701.00090.txt
│ │ ├── 1701.00091.txt
│ │ ├── 1701.00092.txt
│ │ ├── 1701.00094.txt
│ │ ├── 1701.00095.txt
│ │ ├── 1701.00096.txt
│ │ ├── 1701.00097.txt
│ │ ├── 1701.00098.txt
│ │ ├── 1701.00099.txt
│ │ ├── 1701.00100.txt
│ │ ├── 1701.00101.txt
│ │ ├── 1701.00102.txt
│ │ ├── 1701.00103.txt
│ │ ├── 1701.00104.txt
│ │ ├── 1701.00105.txt
│ │ ├── 1701.00106.txt
│ │ ├── 1701.00107.txt
│ │ ├── 1701.00109.txt
│ │ ├── 1701.00110.txt
│ │ ├── 1701.00111.txt
│ │ └── 1701.00112.txt
│ ├── 04-search/
│ │ ├── 01-search.py
│ │ ├── 02-constraint.py
│ │ ├── 03-lemmata.py
│ │ ├── 04-taxonomy.py
│ │ ├── 05-multiple.py
│ │ ├── 06-optional.py
│ │ ├── 07-exclude.py
│ │ ├── 08-group.py
│ │ └── 09-web.py
│ ├── 05-vector/
│ │ ├── 01-document.py
│ │ ├── 02-model.py
│ │ ├── 03-lsa.py
│ │ ├── 04-KNN.py
│ │ ├── 05-nb.py
│ │ ├── 06-svm.py
│ │ ├── 07-slp.py
│ │ └── corpus/
│ │ ├── badger.txt
│ │ ├── bear.txt
│ │ ├── dog.txt
│ │ ├── dolphin.txt
│ │ ├── lion.txt
│ │ ├── parakeet.txt
│ │ ├── rabbit.txt
│ │ ├── shark.txt
│ │ ├── sparrow.txt
│ │ ├── tiger.txt
│ │ └── wolf.txt
│ ├── 06-graph/
│ │ ├── 01-graph.py
│ │ ├── 02-export.py
│ │ ├── 03-template.py
│ │ ├── 04-canvas.html
│ │ ├── 05-trends.py
│ │ ├── 06-commonsense.py
│ │ ├── 07-graphml.py
│ │ └── test.graphml
│ ├── 07-canvas/
│ │ ├── 01-basic.html
│ │ ├── 02-basic.html
│ │ ├── 03-transformation.html
│ │ ├── 04-path.html
│ │ ├── 05-points.html
│ │ ├── 06-image.html
│ │ ├── 08-widget.html
│ │ ├── 09-class.html
│ │ ├── 10-pack.html
│ │ ├── 11-graph.html
│ │ └── data-url.html
│ └── 08-server/
│ ├── 01-basic/
│ │ └── basic.py
│ ├── 02-api/
│ │ └── api.py
│ ├── 03-wiki/
│ │ ├── data/
│ │ │ └── index.html.txt
│ │ └── wiki.py
│ └── 04-db/
│ └── db.py
├── pattern/
│ ├── __init__.py
│ ├── canvas.js
│ ├── db/
│ │ └── __init__.py
│ ├── graph/
│ │ ├── __init__.py
│ │ ├── commonsense.csv
│ │ ├── commonsense.py
│ │ └── graph.js
│ ├── helpers.py
│ ├── metrics.py
│ ├── server/
│ │ ├── __init__.py
│ │ └── static/
│ │ └── robots.txt
│ ├── text/
│ │ ├── __init__.py
│ │ ├── de/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── de-context.txt
│ │ │ ├── de-frequency.txt
│ │ │ ├── de-lexicon.txt
│ │ │ ├── de-morphology.txt
│ │ │ ├── de-spelling.txt
│ │ │ ├── de-verbs.txt
│ │ │ └── inflect.py
│ │ ├── en/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── en-context.txt
│ │ │ ├── en-entities.txt
│ │ │ ├── en-frequency.txt
│ │ │ ├── en-lexicon.txt
│ │ │ ├── en-model.slp
│ │ │ ├── en-morphology.txt
│ │ │ ├── en-sentiment.xml
│ │ │ ├── en-spelling.txt
│ │ │ ├── en-verbs.txt
│ │ │ ├── inflect.py
│ │ │ ├── inflect_quantify.py
│ │ │ ├── modality.py
│ │ │ ├── wordlist/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── academic.txt
│ │ │ │ ├── basic.txt
│ │ │ │ ├── profanity.txt
│ │ │ │ ├── stopwords.txt
│ │ │ │ └── time.txt
│ │ │ └── wordnet/
│ │ │ ├── __init__.py
│ │ │ ├── dict/
│ │ │ │ ├── LICENSE.txt
│ │ │ │ ├── data.adj
│ │ │ │ ├── data.adv
│ │ │ │ ├── data.noun1
│ │ │ │ ├── data.noun2
│ │ │ │ ├── data.verb
│ │ │ │ ├── index.32
│ │ │ │ ├── index.adj
│ │ │ │ ├── index.adv
│ │ │ │ ├── index.noun
│ │ │ │ ├── index.sense
│ │ │ │ ├── index.verb
│ │ │ │ └── lexnames
│ │ │ ├── resnik-ic2.txt
│ │ │ └── resnik-ic3.txt
│ │ ├── es/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── es-context.txt
│ │ │ ├── es-frequency.txt
│ │ │ ├── es-lexicon.txt
│ │ │ ├── es-morphology.txt
│ │ │ ├── es-spelling.txt
│ │ │ ├── es-verbs.txt
│ │ │ └── inflect.py
│ │ ├── fr/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── fr-context.txt
│ │ │ ├── fr-frequency.txt
│ │ │ ├── fr-lexicon.txt
│ │ │ ├── fr-morphology.txt
│ │ │ ├── fr-sentiment.xml
│ │ │ ├── fr-spelling.txt
│ │ │ ├── fr-verbs.txt
│ │ │ └── inflect.py
│ │ ├── it/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── inflect.py
│ │ │ ├── it-context.txt
│ │ │ ├── it-frequency.txt
│ │ │ ├── it-lexicon.txt
│ │ │ ├── it-morphology.txt
│ │ │ ├── it-sentiment.xml
│ │ │ ├── it-spelling.txt
│ │ │ └── it-verbs.txt
│ │ ├── nl/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── inflect.py
│ │ │ ├── nl-context.txt
│ │ │ ├── nl-frequency.txt
│ │ │ ├── nl-lexicon.txt
│ │ │ ├── nl-morphology.txt
│ │ │ ├── nl-sentiment.xml
│ │ │ ├── nl-spelling.txt
│ │ │ └── nl-verbs.txt
│ │ ├── ru/
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── ru-entities.txt
│ │ │ ├── ru-frequency.txt
│ │ │ ├── ru-lexicon.txt
│ │ │ ├── ru-model.slp
│ │ │ ├── ru-spelling.txt
│ │ │ └── wordlist/
│ │ │ ├── __init__.py
│ │ │ └── stopwords.txt
│ │ ├── search.py
│ │ ├── tree.py
│ │ └── xx/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── inflect.py
│ │ ├── xx-context.txt
│ │ ├── xx-frequency.txt
│ │ ├── xx-lexicon.txt
│ │ ├── xx-morphology.txt
│ │ ├── xx-sentiment.xml
│ │ └── xx-verbs.txt
│ ├── vector/
│ │ ├── __init__.py
│ │ ├── stemmer.py
│ │ ├── stopwords-de.txt
│ │ ├── stopwords-en.txt
│ │ ├── stopwords-es.txt
│ │ ├── stopwords-fr.txt
│ │ ├── stopwords-nl.txt
│ │ └── svm/
│ │ ├── COPYRIGHT-liblinear.txt
│ │ ├── COPYRIGHT-libsvm.txt
│ │ ├── INSTALL.txt
│ │ ├── README.txt
│ │ ├── __init__.py
│ │ ├── liblinear.py
│ │ ├── liblinearutil.py
│ │ ├── libsvm.py
│ │ ├── libsvmutil.py
│ │ ├── macos/
│ │ │ ├── liblinear-2.20/
│ │ │ │ └── liblinear.so.3
│ │ │ └── libsvm-3.22/
│ │ │ └── libsvm.so.2
│ │ └── ubuntu/
│ │ ├── liblinear-2.20/
│ │ │ └── liblinear.so.3
│ │ └── libsvm-3.22/
│ │ └── libsvm.so.2
│ └── web/
│ ├── __init__.py
│ ├── api.py
│ ├── cache/
│ │ └── __init__.py
│ ├── imap/
│ │ └── __init__.py
│ ├── locale/
│ │ └── __init__.py
│ ├── oauth/
│ │ └── __init__.py
│ └── utils.py
├── setup.py
└── test/
├── corpora/
│ ├── README.txt
│ ├── carroll-lookingglass.docx
│ ├── plagiarism-clough&stevenson.csv
│ ├── polarity-de-amazon.csv
│ ├── polarity-en-pang&lee1.csv
│ ├── polarity-en-pang&lee2.csv
│ ├── polarity-fr-amazon.csv
│ ├── polarity-nl-bol.com.csv
│ ├── spam-apache.csv
│ ├── spelling-birkbeck.csv
│ ├── spelling-ru.csv
│ ├── tagged-de-tiger.txt
│ ├── tagged-en-oanc.txt
│ ├── tagged-en-wsj.txt
│ ├── tagged-es-wikicorpus.txt
│ ├── tagged-fr-wikinews.txt
│ ├── tagged-it-wacky.txt
│ ├── tagged-nl-twnc.txt
│ ├── uncertainty-conll2010.csv
│ ├── wordforms-de-celex.csv
│ ├── wordforms-en-celex.csv
│ ├── wordforms-es-davies.csv
│ ├── wordforms-fr-lexique.csv
│ ├── wordforms-it-wiktionary.csv
│ └── wordforms-nl-celex.csv
├── test.html
├── test.js
├── test_canvas.js
├── test_db.py
├── test_de.py
├── test_en.py
├── test_es.py
├── test_fr.py
├── test_graph.js
├── test_graph.py
├── test_it.py
├── test_metrics.py
├── test_nl.py
├── test_ru.py
├── test_search.py
├── test_text.py
├── test_vector.py
└── test_web.py
Showing preview only (209K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3178 symbols across 72 files)
FILE: docs/js/shBrushJScript.js
function Brush (line 22) | function Brush()
FILE: docs/js/shBrushPython.js
function Brush (line 22) | function Brush()
FILE: docs/js/shBrushXml.js
function Brush (line 22) | function Brush()
FILE: examples/01-web/08-wiktionary.py
class GenderByName (line 39) | class GenderByName(SVM):
method train (line 41) | def train(self, name, gender=None):
method classify (line 44) | def classify(self, name):
method vector (line 47) | def vector(self, name):
FILE: examples/01-web/13-crawler.py
class SimpleCrawler1 (line 47) | class SimpleCrawler1(Crawler):
method visit (line 49) | def visit(self, link, source=None):
method fail (line 52) | def fail(self, link):
class SimpleCrawler2 (line 150) | class SimpleCrawler2(Crawler):
method visit (line 152) | def visit(self, link, source=None):
method priority (line 155) | def priority(self, link, method=DEPTH):
FILE: examples/04-search/04-taxonomy.py
function find_parents (line 70) | def find_parents(word):
FILE: examples/04-search/07-exclude.py
function imperative (line 36) | def imperative(sentence):
FILE: examples/05-vector/06-svm.py
function instance (line 64) | def instance(review): # "Great book!"
FILE: examples/05-vector/07-slp.py
function corpus (line 34) | def corpus(path, encoding="utf-8"):
FILE: examples/06-graph/03-template.py
function webpage (line 36) | def webpage(graph, **kwargs):
FILE: examples/08-server/01-basic/basic.py
function index (line 43) | def index():
function error_404 (line 61) | def error_404(error):
function products (line 80) | def products(name):
function products2 (line 95) | def products2(*path):
function review (line 118) | def review(text=""):
function cat (line 144) | def cat():
function cat_alias (line 151) | def cat_alias():
FILE: examples/08-server/02-api/api.py
function predict_language (line 41) | def predict_language(q=""):
function predict_language_paid (line 74) | def predict_language_paid(q="", key=None):
FILE: examples/08-server/03-wiki/wiki.py
function index (line 28) | def index(*path, **data):
function name (line 84) | def name(page):
function displayname (line 93) | def displayname(page):
function view (line 102) | def view(page):
function edit (line 117) | def edit(page):
function save (line 130) | def save(page, src):
FILE: examples/08-server/04-db/db.py
function db (line 68) | def db():
function products (line 80) | def products(name, db=None):
FILE: pattern/canvas.js
function $ (line 16) | function $(x, y) {
function attachEvent (line 21) | function attachEvent(element, name, f) {
function Class (line 384) | function Class() {
function _multiple (line 475) | function _multiple(v, round) {
function rgb (line 883) | function rgb(r, g, b) {
function rgba (line 889) | function rgba(r, g, b, a) {
function color (line 895) | function color(r, g, b, a, options) {
function background (line 901) | function background(r, g, b, a) {
function fill (line 915) | function fill(r, g, b, a) {
function stroke (line 923) | function stroke(r, g, b, a) {
function nofill (line 932) | function nofill() {
function nostroke (line 938) | function nostroke() {
function strokewidth (line 944) | function strokewidth(width) {
function strokestyle (line 957) | function strokestyle(style) {
function linecap (line 970) | function linecap(cap) {
function _rgb2hex (line 996) | function _rgb2hex(r, g, b) {
function _hex2rgb (line 1011) | function _hex2rgb(hex) {
function _rgb2hsb (line 1024) | function _rgb2hsb(r, g, b) {
function _hsb2rgb (line 1043) | function _hsb2rgb(h, s, v) {
function _rgb2xyz (line 1061) | function _rgb2xyz(r, g, b) {
function _xyz2rgb (line 1074) | function _xyz2rgb(x, y, z) {
function _xyz2lab (line 1089) | function _xyz2lab(x, y, z) {
function _lab2xyz (line 1105) | function _lab2xyz(l, a, b) {
function _lab2lch (line 1121) | function _lab2lch(l, a, b) {
function _lch2lab (line 1130) | function _lch2lab(l, c, h) {
function _rgb2hcl (line 1139) | function _rgb2hcl(r, g, b) {
function _hcl2rgb (line 1151) | function _hcl2rgb(h, c, l) {
function _rgba2rgb (line 1162) | function _rgba2rgb(r, g, b, a, blend) {
function darker (line 1173) | function darker(clr, step) {
function lighter (line 1182) | function lighter(clr, step) {
function colors (line 1196) | function colors(colors, k, colorspace) {
function _rotateRYB (line 1237) | function _rotateRYB(h, s, b, angle) {
function complement (line 1268) | function complement(clr) {
function analog (line 1275) | function analog(clr, angle, d) {
function _colorMixin (line 1292) | function _colorMixin(options) {
function _ctx_fill (line 1318) | function _ctx_fill(fill) {
function _ctx_stroke (line 1330) | function _ctx_stroke(stroke, strokewidth, strokestyle, linecap) {
function gradient (line 1402) | function gradient(clr1, clr2, options) {
function shadow (line 1408) | function shadow(dx, dy, blur, alpha) {
function noshadow (line 1425) | function noshadow() {
function push (line 1582) | function push() {
function pop (line 1589) | function pop() {
function translate (line 1603) | function translate(x, y) {
function rotate (line 1610) | function rotate(degrees) {
function scale (line 1618) | function scale(x, y) {
function reset (line 1625) | function reset() {
function drawpath (line 2201) | function drawpath(path, options) {
function autoclosepath (line 2211) | function autoclosepath(close) {
function beginpath (line 2218) | function beginpath(x, y) {
function moveto (line 2227) | function moveto(x, y) {
function lineto (line 2233) | function lineto(x, y) {
function curveto (line 2239) | function curveto(x1, y1, x2, y2, x3, y3) {
function closepath (line 2246) | function closepath() {
function endpath (line 2252) | function endpath(options) {
function findpath (line 2265) | function findpath(points, curvature) {
function derive (line 2283) | function derive(points, callback) {
function directed (line 2336) | function directed(points, callback) {
function beginclip (line 2342) | function beginclip(path) {
function endclip (line 2352) | function endclip() {
function supershape (line 2361) | function supershape(x, y, width, height, m, n1, n2, n3, options) {
function line (line 2393) | function line(x0, y0, x1, y1, options) {
function arc (line 2406) | function arc(x, y, radius, angle1, angle2, options) {
function rect (line 2420) | function rect(x, y, width, height, options) {
function triangle (line 2439) | function triangle(x1, y1, x2, y2, x3, y3, options) {
function ellipse (line 2455) | function ellipse(x, y, width, height, options) {
function arrow (line 2466) | function arrow(x, y, width, options) {
function star (line 2484) | function star(x, y, points, outer, inner, options) {
function line0 (line 2508) | function line0(x1, y1, x2, y2, options) {
function rect0 (line 2517) | function rect0(x, y, width, height, options) {
function include (line 2664) | function include(url) {
function asynchronous (line 2705) | function asynchronous(url, data) {
function image (line 2774) | function image(img, x, y, options) {
function imagesize (line 2785) | function imagesize(img) {
function pixels (line 2864) | function pixels(img) {
function font (line 2876) | function font(fontname, fontsize, fontweight) {
function fontsize (line 2885) | function fontsize(fontsize) {
function fontweight (line 2892) | function fontweight(fontweight) {
function lineheight (line 2899) | function lineheight(lineheight) {
function _fontMixin (line 2914) | function _fontMixin(options) {
function _ctx_font (line 2934) | function _ctx_font(fontname, fontsize, fontweight) {
function str (line 2942) | function str(v) {
function text (line 2946) | function text(str, x, y, options) {
function textmetrics (line 2966) | function textmetrics(str, options) {
function textwidth (line 2979) | function textwidth(str, options) {
function textheight (line 2985) | function textheight(str, options) {
function _rndExp (line 3001) | function _rndExp(bias) {
function random (line 3012) | function random(v1, v2, bias) {
function noise (line 3031) | function noise(x, y, m) {
function grid (line 3057) | function grid(cols, rows, colWidth, rowHeight, shuffled) {
function absOffset (line 3082) | function absOffset(element) {
function _uid (line 3219) | function _uid() {
function _unselectable (line 3225) | function _unselectable(element) {
function size (line 3500) | function size(width, height) {
function print (line 3506) | function print() {
function render (line 3570) | function render(callback, width, height) {
function filter (line 3579) | function filter(img, callback) {
function solid (line 3593) | function solid(width, height, clr) {
function invert (line 3605) | function invert(img) {
function colorize (line 3613) | function colorize(img, color, bias) {
function adjust (line 3631) | function adjust(img, options) {
function desaturate (line 3675) | function desaturate(img) {
function brightpass (line 3681) | function brightpass(img, threshold) {
function blur (line 3689) | function blur(img, radius) {
function composite (line 3702) | function composite(img1, img2, dx, dy, operator) {
function transparent (line 3730) | function transparent(img, alpha) {
function mask (line 3738) | function mask(img1, img2, dx, dy, alpha) {
function blend (line 3762) | function blend(mode, img1, img2, dx, dy, alpha) {
function add (line 3827) | function add(img1, img2, dx, dy, alpha) {
function subtract (line 3830) | function subtract(img1, img2, dx, dy, alpha) {
function lighten (line 3833) | function lighten(img1, img2, dx, dy, alpha) {
function darken (line 3836) | function darken(img1, img2, dx, dy, alpha) {
function multiply (line 3839) | function multiply(img1, img2, dx, dy, alpha) {
function screen_ (line 3842) | function screen_(img1, img2, dx, dy, alpha) {
function overlay (line 3845) | function overlay(img1, img2, dx, dy, alpha) {
function hardlight (line 3848) | function hardlight(img1, img2, dx, dy, alpha) {
function hue (line 3851) | function hue(img1, img2, dx, dy, alpha) {
function glow (line 3870) | function glow(img, intensity, radius) {
function bloom (line 3880) | function bloom(img, intensity, radius, threshold) {
function polar (line 3895) | function polar(img, x0, y0, callback) {
function bump (line 3920) | function bump(img, dx, dy, radius, zoom) {
function dent (line 3934) | function dent(img, dx, dy, radius, zoom) {
function pinch (line 3948) | function pinch(img, dx, dy, zoom) {
function splash (line 3961) | function splash(img, dx, dy, radius) {
function twirl (line 3973) | function twirl(img, dx, dy, radius, angle) {
function distort (line 3993) | function distort(mode, img, options) {
function widget (line 4027) | function widget(canvas, variable, type, options) {
function _stackblur (line 4196) | function _stackblur(img, buffer, radius) {
function _IEVersion (line 4210) | function _IEVersion() {
function X (line 4235) | function X(){return this.context_||(this.context_=new H(this))}
function Y (line 4235) | function Y(b,a){var c=L.call(arguments,2);return function(){return b.app...
function Z (line 4237) | function Z(b){var a=b.srcElement;switch(b.propertyName){case "width":a.s...
function $ (line 4238) | function $(b){var a=b.srcElement;if(a.firstChild){a.firstChild.style.wid...
function I (line 4238) | function I(){return[[1,0,0],[0,1,0],[0,0,1]]}
function y (line 4238) | function y(b,a){var c=I(),d=0;for(;d<3;d++){var f=0;for(;f<3;f++){var h=...
function O (line 4239) | function O(b,a){a.fillStyle=b.fillStyle;a.lineCap=b.lineCap;a.lineJoin=b...
function P (line 4239) | function P(b){var a,c=1;b=String(b);if(b.substring(0,3)=="rgb"){var d=b....
function aa (line 4240) | function aa(b){switch(b){case "butt":return"flat";case "round":return"ro...
function H (line 4240) | function H(b){this.m_=I();this.mStack_=[];this.aStack_=[];this.currentPa...
function Q (line 4242) | function Q(b,a,c,d){b.currentPath_.push({type:"bezierCurveTo",cp1x:a.x,c...
function ha (line 4254) | function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b...
function A (line 4254) | function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][...
function D (line 4255) | function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=...
function U (line 4255) | function U(){}
FILE: pattern/db/__init__.py
function _import_db (line 64) | def _import_db(engine=SQLITE):
function pd (line 78) | def pd(*args):
function _yyyywwd2yyyymmdd (line 112) | def _yyyywwd2yyyymmdd(year, week, weekday):
function _strftime1900 (line 120) | def _strftime1900(d, format):
class DateError (line 128) | class DateError(Exception):
class Date (line 132) | class Date(datetime):
method minutes (line 143) | def minutes(self):
method seconds (line 147) | def seconds(self):
method microseconds (line 151) | def microseconds(self):
method week (line 155) | def week(self):
method weekday (line 159) | def weekday(self):
method timestamp (line 163) | def timestamp(self):
method strftime (line 171) | def strftime(self, format):
method copy (line 174) | def copy(self):
method __str__ (line 177) | def __str__(self):
method __repr__ (line 180) | def __repr__(self):
method __iadd__ (line 183) | def __iadd__(self, t):
method __isub__ (line 186) | def __isub__(self, t):
method __add__ (line 189) | def __add__(self, t):
method __sub__ (line 201) | def __sub__(self, t):
function date (line 214) | def date(*args, **kwargs):
class Time (line 287) | class Time(timedelta):
method __new__ (line 289) | def __new__(cls, *args, **kwargs):
function time (line 305) | def time(days=0, seconds=0, minutes=0, hours=0, **kwargs):
function string (line 312) | def string(value, default=""):
class EncryptionError (line 321) | class EncryptionError(Exception):
class DecryptionError (line 325) | class DecryptionError(Exception):
function encrypt_string (line 329) | def encrypt_string(s, key=""):
function decrypt_string (line 344) | def decrypt_string(s, key=""):
function encode_entities (line 364) | def encode_entities(string):
function decode_entities (line 378) | def decode_entities(string):
class _Binary (line 397) | class _Binary(object):
method __init__ (line 402) | def __init__(self, data, type=SQLITE):
method escape (line 405) | def escape(self):
function _escape (line 412) | def _escape(value, quote=lambda string: "'%s'" % string.replace("'", "\\...
function cast (line 446) | def cast(x, f, default=None):
function find (line 465) | def find(match=lambda item: False, list=[]):
function order (line 473) | def order(list, cmp=None, key=None, reverse=False):
function avg (line 491) | def avg(list):
function variance (line 498) | def variance(list):
function stdev (line 506) | def stdev(list):
class sqlite_first (line 517) | class sqlite_first(list):
method step (line 518) | def step(self, value): self.append(value)
method finalize (line 520) | def finalize(self):
class sqlite_last (line 524) | class sqlite_last(list):
method step (line 525) | def step(self, value): self.append(value)
method finalize (line 527) | def finalize(self):
class sqlite_group_concat (line 531) | class sqlite_group_concat(list):
method step (line 532) | def step(self, value): self.append(value)
method finalize (line 534) | def finalize(self):
function sqlite_year (line 541) | def sqlite_year(datestring):
function sqlite_month (line 545) | def sqlite_month(datestring):
function sqlite_day (line 549) | def sqlite_day(datestring):
function sqlite_hour (line 553) | def sqlite_hour(datestring):
function sqlite_minute (line 557) | def sqlite_minute(datestring):
function sqlite_second (line 561) | def sqlite_second(datestring):
class DatabaseConnectionError (line 567) | class DatabaseConnectionError(Exception):
class Database (line 571) | class Database(object):
class Tables (line 573) | class Tables(dict):
method __init__ (line 576) | def __init__(self, db, *args, **kwargs):
method __getitem__ (line 580) | def __getitem__(self, k):
method __init__ (line 585) | def __init__(self, name, host="localhost", port=3306, username="root",...
method connect (line 611) | def connect(self, unicode=True):
method disconnect (line 665) | def disconnect(self):
method connection (line 672) | def connection(self):
method connected (line 676) | def connected(self):
method __getattr__ (line 679) | def __getattr__(self, k):
method __len__ (line 688) | def __len__(self):
method __iter__ (line 691) | def __iter__(self):
method __getitem__ (line 694) | def __getitem__(self, table):
method __setitem__ (line 697) | def __setitem__(self, table, fields):
method __delitem__ (line 700) | def __delitem__(self, table):
method __nonzero__ (line 703) | def __nonzero__(self):
method _get_user (line 707) | def _get_user(self):
method _set_user (line 710) | def _set_user(self, v):
method query (line 715) | def query(self):
method execute (line 720) | def execute(self, SQL, commit=False):
class RowsIterator (line 734) | class RowsIterator(object):
method __init__ (line 738) | def __init__(self, cursor):
method __next__ (line 742) | def __next__(self):
method __iter__ (line 745) | def __iter__(self):
method __del__ (line 748) | def __del__(self):
method commit (line 751) | def commit(self):
method rollback (line 756) | def rollback(self):
method escape (line 761) | def escape(self, value):
method binary (line 775) | def binary(self, data):
method _field_SQL (line 782) | def _field_SQL(self, table, field):
method create (line 805) | def create(self, table, fields=[], encoding="utf-8", **kwargs):
method drop (line 825) | def drop(self, table):
method link (line 837) | def link(self, table1, field1, table2, field2, join="left"):
method __repr__ (line 848) | def __repr__(self):
method _delete (line 854) | def _delete(self):
method __delete__ (line 864) | def __delete__(self):
class _String (line 873) | class _String(str):
method __new__ (line 876) | def __new__(self):
method __call__ (line 879) | def __call__(self, length=100):
function field (line 903) | def field(name, type=STRING, **kwargs):
function primary_key (line 930) | def primary_key(name="id"):
class Schema (line 940) | class Schema(object):
method __init__ (line 942) | def __init__(self, name, type, default=None, index=False, optional=Tru...
method __repr__ (line 991) | def __repr__(self):
class TableError (line 1004) | class TableError(Exception):
class Table (line 1008) | class Table(object):
class Fields (line 1010) | class Fields(list):
method __init__ (line 1014) | def __init__(self, table, *args, **kwargs):
method append (line 1018) | def append(self, field):
method extend (line 1024) | def extend(self, fields):
method __setitem__ (line 1027) | def __setitem__(self, *args, **kwargs):
method __init__ (line 1031) | def __init__(self, name, database):
method _update (line 1043) | def _update(self):
method _get_name (line 1070) | def _get_name(self):
method _set_name (line 1073) | def _set_name(self, name):
method db (line 1089) | def db(self):
method pk (line 1093) | def pk(self):
method count (line 1096) | def count(self):
method __len__ (line 1101) | def __len__(self):
method __iter__ (line 1104) | def __iter__(self):
method __getitem__ (line 1107) | def __getitem__(self, id):
method __setitem__ (line 1110) | def __setitem__(self, id, row):
method __delitem__ (line 1114) | def __delitem__(self, id):
method abs (line 1117) | def abs(self, field):
method iterrows (line 1122) | def iterrows(self):
method rows (line 1127) | def rows(self):
method record (line 1132) | def record(self, row):
class Rows (line 1137) | class Rows(list):
method __init__ (line 1142) | def __init__(self, table, data):
method record (line 1146) | def record(self, row):
method filter (line 1149) | def filter(self, *args, **kwargs):
method find (line 1174) | def find(self, *args, **kwargs):
method search (line 1177) | def search(self, *args, **kwargs):
method _insert_id (line 1184) | def _insert_id(self):
method insert (line 1191) | def insert(self, *args, **kwargs):
method update (line 1211) | def update(self, id, *args, **kwargs):
method delete (line 1232) | def delete(self, id, commit=True):
method xml (line 1248) | def xml(self):
method datasheet (line 1251) | def datasheet(self):
method __repr__ (line 1254) | def __repr__(self):
function abs (line 1274) | def abs(table, field):
function cmp (line 1290) | def cmp(field, value, comparison="=", escape=lambda v: _escape(v), table...
function year (line 1336) | def year(date):
function month (line 1340) | def month(date):
function day (line 1344) | def day(date):
function hour (line 1348) | def hour(date):
function minute (line 1352) | def minute(date):
function second (line 1356) | def second(date):
function count (line 1362) | def count(value):
function sum (line 1366) | def sum(value):
class Filter (line 1374) | class Filter(tuple):
method __new__ (line 1375) | def __new__(cls, field, value, comparison):
method SQL (line 1378) | def SQL(self, **kwargs):
function filter (line 1382) | def filter(field, value, comparison="="):
function eq (line 1386) | def eq(field, value):
function eqi (line 1390) | def eqi(field, value):
function ne (line 1394) | def ne(field, value):
function gt (line 1398) | def gt(field, value):
function lt (line 1402) | def lt(field, value):
function gte (line 1406) | def gte(field, value):
function lte (line 1410) | def lte(field, value):
function rng (line 1414) | def rng(field, value):
class FilterChain (line 1418) | class FilterChain(list):
method __init__ (line 1420) | def __init__(self, *args, **kwargs):
method SQL (line 1436) | def SQL(self, **kwargs):
function all (line 1465) | def all(*args, **kwargs):
function any (line 1472) | def any(*args, **kwargs):
class Relation (line 1492) | class Relation(tuple):
method __new__ (line 1493) | def __new__(cls, field1, field2, table, join):
function relation (line 1497) | def relation(field1, field2, table, join=LEFT):
class Query (line 1511) | class Query(object):
method __init__ (line 1515) | def __init__(self, table, fields=ALL, filters=[], relations=[], sort=N...
method table (line 1540) | def table(self):
method __len__ (line 1543) | def __len__(self):
method __iter__ (line 1546) | def __iter__(self):
method __getitem__ (line 1549) | def __getitem__(self, i):
method SQL (line 1552) | def SQL(self):
method execute (line 1622) | def execute(self):
method iterrows (line 1627) | def iterrows(self):
method rows (line 1632) | def rows(self):
method record (line 1637) | def record(self, row):
method xml (line 1643) | def xml(self):
method __repr__ (line 1646) | def __repr__(self):
function associative (line 1650) | def associative(query):
class View (line 1663) | class View(object):
method __init__ (line 1665) | def __init__(self, database, table, schema=[]):
method db (line 1674) | def db(self):
method table (line 1678) | def table(self):
method setup (line 1684) | def setup(self, overwrite=False):
method render (line 1692) | def render(self, *path, **query):
method default (line 1703) | def default(self, *path, **query):
function _unpack_fields (line 1712) | def _unpack_fields(table, fields=[]):
function xml_format (line 1734) | def xml_format(a):
function xml (line 1753) | def xml(rows):
function parse_xml (line 1814) | def parse_xml(database, xml, table=None, field=lambda s: s.replace(".", ...
function csv_header_encode (line 1885) | def csv_header_encode(field, type=STRING):
function csv_header_decode (line 1893) | def csv_header_decode(s):
class CSV (line 1901) | class CSV(list):
method __new__ (line 1903) | def __new__(cls, rows=[], fields=None, **kwargs):
method __init__ (line 1912) | def __init__(self, rows=[], fields=None, **kwargs):
method extend (line 1920) | def extend(self, rows, **kwargs):
method _set_headers (line 1923) | def _set_headers(self, v):
method _get_headers (line 1926) | def _get_headers(self):
method save (line 1931) | def save(self, path, separator=",", encoder=lambda v: v, headers=False...
method load (line 1957) | def load(cls, path, separator=",", decoder=lambda v: v, headers=False,...
class Datasheet (line 2019) | class Datasheet(CSV):
method __init__ (line 2021) | def __init__(self, rows=[], fields=None, **kwargs):
method _get_rows (line 2034) | def _get_rows(self):
method _set_rows (line 2037) | def _set_rows(self, rows):
method _get_columns (line 2045) | def _get_columns(self):
method _set_columns (line 2048) | def _set_columns(self, columns):
method __getattr__ (line 2056) | def __getattr__(self, k):
method __setattr__ (line 2067) | def __setattr__(self, k, v):
method __setitem__ (line 2089) | def __setitem__(self, index, value):
method __getitem__ (line 2102) | def __getitem__(self, index):
method __delitem__ (line 2130) | def __delitem__(self, index):
method __add__ (line 2136) | def __add__(self, datasheet):
method __radd__ (line 2141) | def __radd__(self, datasheet):
method __iadd__ (line 2146) | def __iadd__(self, datasheet):
method insert (line 2150) | def insert(self, i, row, default=None, **kwargs):
method append (line 2171) | def append(self, row, default=None, _m=None, **kwargs):
method extend (line 2174) | def extend(self, rows, default=None, **kwargs):
method group (line 2178) | def group(self, j, function=FIRST, key=lambda v: v):
method record (line 2232) | def record(self, row):
method map (line 2237) | def map(self, function=lambda item: item):
method slice (line 2244) | def slice(self, i, j, n, m):
method copy (line 2249) | def copy(self, rows=ALL, columns=ALL):
method array (line 2262) | def array(self):
method json (line 2270) | def json(self, **kwargs):
method html (line 2282) | def html(self):
function flip (line 2315) | def flip(datasheet):
function csv (line 2321) | def csv(*args, **kwargs):
class DatasheetRows (line 2332) | class DatasheetRows(list):
method __init__ (line 2334) | def __init__(self, datasheet):
method __setitem__ (line 2337) | def __setitem__(self, i, row):
method __getitem__ (line 2341) | def __getitem__(self, i):
method __getslice__ (line 2344) | def __getslice__(self, i, j):
method __delitem__ (line 2347) | def __delitem__(self, i):
method __len__ (line 2350) | def __len__(self):
method __iter__ (line 2353) | def __iter__(self):
method __repr__ (line 2357) | def __repr__(self):
method __add__ (line 2360) | def __add__(self, row):
method __iadd__ (line 2363) | def __iadd__(self, row):
method __eq__ (line 2367) | def __eq__(self, rows):
method __ne__ (line 2370) | def __ne__(self, rows):
method insert (line 2373) | def insert(self, i, row, default=None):
method append (line 2376) | def append(self, row, default=None):
method extend (line 2379) | def extend(self, rows, default=None):
method remove (line 2382) | def remove(self, row):
method pop (line 2385) | def pop(self, i):
method count (line 2388) | def count(self, row):
method index (line 2391) | def index(self, row):
method sort (line 2394) | def sort(self, cmp=None, key=None, reverse=False):
method reverse (line 2397) | def reverse(self):
method swap (line 2400) | def swap(self, i1, i2):
class DatasheetColumns (line 2406) | class DatasheetColumns(list):
method __init__ (line 2408) | def __init__(self, datasheet):
method __setitem__ (line 2413) | def __setitem__(self, j, column):
method __getitem__ (line 2422) | def __getitem__(self, j):
method __getslice__ (line 2429) | def __getslice__(self, i, j):
method __delitem__ (line 2432) | def __delitem__(self, j):
method __len__ (line 2435) | def __len__(self):
method __iter__ (line 2438) | def __iter__(self):
method __repr__ (line 2442) | def __repr__(self):
method __add__ (line 2445) | def __add__(self, column):
method __iadd__ (line 2448) | def __iadd__(self, column):
method __eq__ (line 2452) | def __eq__(self, columns):
method __ne__ (line 2455) | def __ne__(self, columns):
method insert (line 2458) | def insert(self, j, column, default=None, field=None):
method append (line 2477) | def append(self, column, default=None, field=None):
method extend (line 2480) | def extend(self, columns, default=None, fields=[]):
method remove (line 2484) | def remove(self, column):
method pop (line 2490) | def pop(self, j):
method count (line 2510) | def count(self, column):
method index (line 2513) | def index(self, column):
method sort (line 2518) | def sort(self, cmp=None, key=None, reverse=False, order=None):
method swap (line 2535) | def swap(self, j1, j2):
class DatasheetColumn (line 2546) | class DatasheetColumn(list):
method __init__ (line 2548) | def __init__(self, datasheet, j):
method __getslice__ (line 2556) | def __getslice__(self, i, j):
method __getitem__ (line 2559) | def __getitem__(self, i):
method __setitem__ (line 2562) | def __setitem__(self, i, value):
method __len__ (line 2565) | def __len__(self):
method __iter__ (line 2568) | def __iter__(self): # Can be put more simply but optimized for perform...
method __reversed__ (line 2572) | def __reversed__(self):
method __repr__ (line 2575) | def __repr__(self):
method __gt__ (line 2578) | def __gt__(self, column):
method __lt__ (line 2581) | def __lt__(self, column):
method __ge__ (line 2584) | def __ge__(self, column):
method __le__ (line 2587) | def __le__(self, column):
method __eq__ (line 2590) | def __eq__(self, column):
method __ne__ (line 2593) | def __ne__(self, column):
method __add__ (line 2596) | def __add__(self, column):
method __iadd__ (line 2599) | def __iadd__(self, column):
method __contains__ (line 2602) | def __contains__(self, value):
method count (line 2608) | def count(self, value):
method index (line 2611) | def index(self, value):
method remove (line 2617) | def remove(self, value):
method pop (line 2626) | def pop(self, i):
method sort (line 2632) | def sort(self, cmp=None, key=None, reverse=False):
method insert (line 2641) | def insert(self, i, value, default=None):
method append (line 2647) | def append(self, value, default=None):
method extend (line 2650) | def extend(self, values, default=None):
method map (line 2654) | def map(self, function=lambda value: value):
method filter (line 2660) | def filter(self, function=lambda value: True):
method swap (line 2669) | def swap(self, i1, i2):
function uid (line 2677) | def uid():
function truncate (line 2683) | def truncate(string, length=100):
function pprint (line 2703) | def pprint(datasheet, truncate=40, padding=" ", fill="."):
FILE: pattern/graph/__init__.py
function unique (line 41) | def unique(iterable):
function line (line 52) | def line(x1, y1, x2, y2, stroke=(0, 0, 0, 1), strokewidth=1):
function ellipse (line 58) | def ellipse(x, y, width, height, fill=(0, 0, 0, 1), stroke=None, strokew...
class Text (line 64) | class Text(object):
method __init__ (line 66) | def __init__(self, string, **kwargs):
method copy (line 73) | def copy(self):
method draw (line 78) | def draw(self):
class Vector (line 82) | class Vector(object):
method __init__ (line 84) | def __init__(self, x=0, y=0):
function coordinates (line 89) | def coordinates(x, y, distance, angle):
function deepcopy (line 98) | def deepcopy(o):
class Node (line 118) | class Node(object):
method __init__ (line 120) | def __init__(self, id="", radius=5, **kwargs):
method _distance (line 145) | def _distance(self):
method _get_x (line 149) | def _get_x(self):
method _get_y (line 152) | def _get_y(self):
method _set_x (line 155) | def _set_x(self, v):
method _set_y (line 158) | def _set_y(self, v):
method edges (line 165) | def edges(self):
method edge (line 173) | def edge(self, node, reverse=False):
method weight (line 183) | def weight(self):
method centrality (line 191) | def centrality(self):
method degree (line 202) | def degree(self):
method flatten (line 207) | def flatten(self, depth=1, traversable=lambda node, edge: True, _visit...
method draw (line 222) | def draw(self, weighted=False):
method contains (line 248) | def contains(self, x, y):
method __repr__ (line 254) | def __repr__(self):
method __eq__ (line 257) | def __eq__(self, node):
method __ne__ (line 260) | def __ne__(self, node):
class Links (line 271) | class Links(list):
method __init__ (line 273) | def __init__(self):
method append (line 279) | def append(self, node, edge=None):
method remove (line 284) | def remove(self, node):
method edge (line 288) | def edge(self, node):
class Edge (line 294) | class Edge(object):
method __init__ (line 296) | def __init__(self, node1, node2, weight=0.0, length=1.0, type=None, st...
method _get_weight (line 309) | def _get_weight(self):
method _set_weight (line 312) | def _set_weight(self, v):
method draw (line 322) | def draw(self, weighted=False, directed=False):
method draw_arrow (line 335) | def draw_arrow(self, **kwargs):
method __repr__ (line 354) | def __repr__(self):
class nodedict (line 362) | class nodedict(dict):
method __init__ (line 364) | def __init__(self, graph, *args, **kwargs):
method __contains__ (line 371) | def __contains__(self, node):
method __getitem__ (line 374) | def __getitem__(self, node):
method get (line 377) | def get(self, node, default=None):
class Graph (line 396) | class Graph(dict):
method __init__ (line 398) | def __init__(self, layout=SPRING, distance=10.0):
method __getitem__ (line 408) | def __getitem__(self, id):
method append (line 414) | def append(self, base, *args, **kwargs):
method add_node (line 423) | def add_node(self, id, *args, **kwargs):
method add_edge (line 438) | def add_edge(self, id1, id2, *args, **kwargs):
method remove (line 463) | def remove(self, x):
method node (line 484) | def node(self, id):
method edge (line 491) | def edge(self, id1, id2):
method paths (line 500) | def paths(self, node1, node2, length=4, path=[]):
method shortest_path (line 509) | def shortest_path(self, node1, node2, heuristic=None, directed=False):
method shortest_paths (line 523) | def shortest_paths(self, node, heuristic=None, directed=False):
method eigenvector_centrality (line 533) | def eigenvector_centrality(self, normalized=True, reversed=True, ratin...
method betweenness_centrality (line 544) | def betweenness_centrality(self, normalized=True, directed=False):
method sorted (line 555) | def sorted(self, order=WEIGHT, threshold=0.0):
method prune (line 563) | def prune(self, depth=0):
method fringe (line 569) | def fringe(self, depth=0, traversable=lambda node, edge: True):
method density (line 578) | def density(self):
method is_complete (line 585) | def is_complete(self):
method is_dense (line 589) | def is_dense(self):
method is_sparse (line 593) | def is_sparse(self):
method split (line 596) | def split(self):
method update (line 601) | def update(self, iterations=10, **kwargs):
method draw (line 607) | def draw(self, weighted=False, directed=False):
method node_at (line 615) | def node_at(self, x, y):
method _add_node_copy (line 622) | def _add_node_copy(self, n, **kwargs):
method _add_edge_copy (line 634) | def _add_edge_copy(self, e, **kwargs):
method copy (line 645) | def copy(self, nodes=ALL):
method export (line 657) | def export(self, *args, **kwargs):
method write (line 660) | def write(self, *args, **kwargs):
method serialize (line 663) | def serialize(self, *args, **kwargs):
class GraphLayout (line 671) | class GraphLayout(object):
method __init__ (line 673) | def __init__(self, graph):
method update (line 679) | def update(self):
method reset (line 682) | def reset(self):
method bounds (line 690) | def bounds(self):
method copy (line 706) | def copy(self, graph):
class GraphSpringLayout (line 712) | class GraphSpringLayout(GraphLayout):
method __init__ (line 714) | def __init__(self, graph):
method _distance (line 724) | def _distance(self, node1, node2):
method _repulse (line 736) | def _repulse(self, node1, node2):
method _attract (line 746) | def _attract(self, node1, node2, weight=0, length=1.0):
method update (line 758) | def update(self, weight=10.0, limit=0.5):
method copy (line 779) | def copy(self, graph):
function depth_first_search (line 789) | def depth_first_search(node, visit=lambda node: False, traversable=lambd...
function breadth_first_search (line 813) | def breadth_first_search(node, visit=lambda node: False, traversable=lam...
function paths (line 830) | def paths(graph, id1, id2, length=4, path=[], _root=True):
function edges (line 850) | def edges(path):
function adjacency (line 861) | def adjacency(graph, directed=False, reversed=False, stochastic=False, h...
function dijkstra_shortest_path (line 895) | def dijkstra_shortest_path(graph, id1, id2, heuristic=None, directed=Fal...
function dijkstra_shortest_paths (line 921) | def dijkstra_shortest_paths(graph, id, heuristic=None, directed=False):
function floyd_warshall_all_pairs_distance (line 953) | def floyd_warshall_all_pairs_distance(graph, heuristic=None, directed=Fa...
function predecessor_path (line 991) | def predecessor_path(tree, u, v):
function brandes_betweenness_centrality (line 1005) | def brandes_betweenness_centrality(graph, normalized=True, directed=False):
function eigenvector_centrality (line 1058) | def eigenvector_centrality(graph, normalized=True, reversed=True, rating...
function union (line 1100) | def union(a, b):
function intersection (line 1104) | def intersection(a, b):
function difference (line 1108) | def difference(a, b):
function partition (line 1112) | def partition(graph):
function is_clique (line 1130) | def is_clique(graph):
function clique (line 1140) | def clique(graph, id):
function cliques (line 1155) | def cliques(graph, threshold=3):
function unlink (line 1172) | def unlink(graph, node1, node2=None):
function redirect (line 1191) | def redirect(graph, node1, node2):
function cut (line 1207) | def cut(graph, node):
function insert (line 1223) | def insert(graph, node, a, b):
class GraphRenderer (line 1245) | class GraphRenderer(object):
method __init__ (line 1247) | def __init__(self, graph):
method serialize (line 1250) | def serialize(self, *args, **kwargs):
method export (line 1253) | def export(self, path, *args, **kwargs):
function minify (line 1260) | def minify(js):
class HTMLCanvasRenderer (line 1285) | class HTMLCanvasRenderer(GraphRenderer):
method __init__ (line 1287) | def __init__(self, graph, **kwargs):
method _escape (line 1349) | def _escape(self, s):
method _rgba (line 1354) | def _rgba(self, clr):
method data (line 1359) | def data(self):
method _data (line 1366) | def _data(self):
method script (line 1441) | def script(self):
method _script (line 1448) | def _script(self):
method canvas (line 1520) | def canvas(self):
method style (line 1534) | def style(self):
method html (line 1550) | def html(self):
method serialize (line 1579) | def serialize(self, type=HTML):
method export (line 1594) | def export(self, path, encoding="utf-8"):
class GraphMLRenderer (line 1625) | class GraphMLRenderer(GraphRenderer):
method serialize (line 1627) | def serialize(self, directed=False):
method export (line 1634) | def export(self, path, directed=False, encoding="utf-8"):
function export (line 1690) | def export(graph, path, encoding="utf-8", **kwargs):
function serialize (line 1703) | def serialize(graph, type=HTML, **kwargs):
FILE: pattern/graph/commonsense.py
class Concept (line 52) | class Concept(Node):
method __init__ (line 54) | def __init__(self, *args, **kwargs):
method halo (line 61) | def halo(self, depth=2):
method properties (line 69) | def properties(self):
function halo (line 81) | def halo(concept, depth=2):
function properties (line 85) | def properties(concept, depth=2, centrality=BETWEENNESS):
class Relation (line 94) | class Relation(Edge):
method __init__ (line 96) | def __init__(self, *args, **kwargs):
class Commonsense (line 120) | class Commonsense(Graph):
method __init__ (line 122) | def __init__(self, data=os.path.join(MODULE, "commonsense.csv"), **kwa...
method concepts (line 147) | def concepts(self):
method relations (line 151) | def relations(self):
method properties (line 155) | def properties(self):
method add_node (line 165) | def add_node(self, id, *args, **kwargs):
method add_edge (line 172) | def add_edge(self, id1, id2, *args, **kwargs):
method remove (line 179) | def remove(self, x):
method similarity (line 183) | def similarity(self, concept1, concept2, k=3, heuristic=COMMONALITY):
method nearest_neighbors (line 211) | def nearest_neighbors(self, concept, concepts=[], k=3):
method taxonomy (line 218) | def taxonomy(self, concept, depth=3, fringe=2):
function download (line 244) | def download(path=os.path.join(MODULE, "commonsense.csv"), threshold=50):
function json (line 293) | def json():
FILE: pattern/graph/graph.js
function attachEvent (line 10) | function attachEvent(element, name, f) {
function _unselectable (line 142) | function _unselectable(element) {
function Class (line 212) | function Class() {
function _parseRGBA (line 230) | function _parseRGBA(clr) {
function _ctx_graph_fillStyle (line 248) | function _ctx_graph_fillStyle(clr, ctx) {
function _ctx_graph_strokeStyle (line 265) | function _ctx_graph_strokeStyle(clr, ctx) {
function _ctx_graph_lineWidth (line 280) | function _ctx_graph_lineWidth(w1, w2, ctx) {
function edges (line 1225) | function edges(path) {
function flatten (line 1313) | function flatten(array) {
function normalize (line 1459) | function normalize(vector) {
FILE: pattern/helpers.py
function decode_string (line 15) | def decode_string(v, encoding="utf-8"):
function encode_string (line 30) | def encode_string(v, encoding="utf-8"):
FILE: pattern/metrics.py
class freq (line 33) | class freq(Counter):
method __init__ (line 35) | def __init__(self, *args, **kwargs):
method __missing__ (line 40) | def __missing__(self):
method __iter__ (line 43) | def __iter__(self):
method items (line 46) | def items(self, relative=False):
method keys (line 56) | def keys(self):
method values (line 59) | def values(self, relative=False):
method copy (line 62) | def copy(self):
function cumsum (line 68) | def cumsum(iterable):
function duration (line 79) | def duration(function, *args, **kwargs):
function profile (line 87) | def profile(function, *args, **kwargs):
function sizeof (line 113) | def sizeof(object):
function kb (line 119) | def kb(object):
function confusion_matrix (line 131) | def confusion_matrix(classify=lambda document: False, documents=[(None, ...
function test (line 156) | def test(classify=lambda document: False, documents=[], average=None):
function accuracy (line 176) | def accuracy(classify=lambda document: False, documents=[], average=None):
function precision (line 182) | def precision(classify=lambda document: False, documents=[], average=None):
function recall (line 188) | def recall(classify=lambda document: False, documents=[], average=None):
function F1 (line 194) | def F1(classify=lambda document: False, documents=[], average=None):
function F (line 200) | def F(classify=lambda document: False, documents=[], beta=1, average=None):
function sensitivity (line 210) | def sensitivity(classify=lambda document: False, documents=[]):
function specificity (line 216) | def specificity(classify=lambda document: False, documents=[]):
function roc (line 229) | def roc(tests=[]):
function auc (line 240) | def auc(curve=[]):
function fleiss_kappa (line 257) | def fleiss_kappa(m):
function levenshtein (line 291) | def levenshtein(string1, string2):
function levenshtein_similarity (line 314) | def levenshtein_similarity(string1, string2):
function dice_coefficient (line 320) | def dice_coefficient(string1, string2):
function similarity (line 334) | def similarity(string1, string2, metric=LEVENSHTEIN):
function flesch_reading_ease (line 349) | def flesch_reading_ease(string):
function ngrams (line 394) | def ngrams(string, n=3, punctuation=PUNCTUATION, **kwargs):
class Weight (line 407) | class Weight(float):
method __new__ (line 412) | def __new__(self, value=0.0, assessments=[]):
method __init__ (line 415) | def __init__(self, value=0.0, assessments=[]):
method __iadd__ (line 418) | def __iadd__(self, value):
method __isub__ (line 421) | def __isub__(self, value):
method __imul__ (line 424) | def __imul__(self, value):
method __idiv__ (line 427) | def __idiv__(self, value):
function intertextuality (line 431) | def intertextuality(texts=[], n=5, weight=lambda ngram: 1.0, **kwargs):
function type_token_ratio (line 463) | def type_token_ratio(string, n=100, punctuation=PUNCTUATION):
function suffixes (line 481) | def suffixes(inflections=[], n=3, top=10, reverse=True):
class Sentinel (line 513) | class Sentinel(object):
function isplit (line 517) | def isplit(string, sep="\t\n\x0b\x0c\r "):
function cooccurrence (line 534) | def cooccurrence(iterable, window=(-1, -1), term1=lambda x: True, term2=...
function lerp (line 617) | def lerp(a, b, t):
function smoothstep (line 628) | def smoothstep(a, b, x):
function smoothrange (line 640) | def smoothrange(a=None, b=None, n=10):
function mean (line 682) | def mean(iterable):
function hmean (line 692) | def hmean(iterable):
function median (line 699) | def median(iterable, sort=True):
function variance (line 711) | def variance(iterable, sample=False):
function standard_deviation (line 722) | def standard_deviation(iterable, *args, **kwargs):
function simple_moving_average (line 732) | def simple_moving_average(iterable, k=10):
function histogram (line 745) | def histogram(iterable, k=10, interval=None, *args, **kwargs):
function moment (line 773) | def moment(iterable, n=2, sample=False):
function skewness (line 784) | def skewness(iterable, sample=False):
function kurtosis (line 798) | def kurtosis(iterable, sample=False):
function quantile (line 816) | def quantile(iterable, p=0.5, sort=True, a=1, b=-1, c=0, d=1):
function boxplot (line 841) | def boxplot(iterable, **kwargs):
function fisher_exact_test (line 859) | def fisher_exact_test(a, b, c, d, **kwargs):
function _expected (line 910) | def _expected(observed):
function pearson_chi_squared_test (line 926) | def pearson_chi_squared_test(observed=[], expected=[], df=None, tail=UPP...
function chi2p (line 960) | def chi2p(x2, df=1, tail=UPPER):
function pearson_log_likelihood_ratio (line 972) | def pearson_log_likelihood_ratio(observed=[], expected=[], df=None, tail...
function kolmogorov_smirnov_two_sample_test (line 1003) | def kolmogorov_smirnov_two_sample_test(a1, a2=NORMAL, n=1000):
function gamma (line 1039) | def gamma(x):
function gammaln (line 1045) | def gammaln(x):
function gammai (line 1066) | def gammai(a, x, tail=UPPER):
function erf (line 1121) | def erf(x):
function erfc (line 1127) | def erfc(x):
function cdf (line 1153) | def cdf(x, mean=0.0, stdev=1.0):
function pdf (line 1159) | def pdf(x, mean=0.0, stdev=1.0):
function norm (line 1169) | def norm(n, mean=0.0, stdev=1.0):
function kolmogorov (line 1178) | def kolmogorov(x):
FILE: pattern/server/__init__.py
function chown (line 86) | def chown(path, owner=None):
function encode_entities (line 116) | def encode_entities(string):
function decode_entities (line 130) | def decode_entities(string):
function encode_url (line 149) | def encode_url(string):
function decode_url (line 153) | def decode_url(string):
function openable (line 159) | def openable(string, **kwargs):
function define (line 173) | def define(f):
class Row (line 206) | class Row(dict):
method __init__ (line 208) | def __init__(self, cursor, row):
method __getattr__ (line 214) | def __getattr__(self, k):
class DatabaseError (line 218) | class DatabaseError(Exception):
class Database (line 222) | class Database(object):
method __init__ (line 224) | def __init__(self, name, **kwargs):
method name (line 250) | def name(self):
method type (line 256) | def type(self):
method host (line 262) | def host(self):
method port (line 268) | def port(self):
method connection (line 274) | def connection(self):
method connect (line 279) | def connect(self):
method disconnect (line 298) | def disconnect(self):
method execute (line 304) | def execute(self, sql, values=(), first=False, commit=True):
method commit (line 323) | def commit(self):
method rollback (line 328) | def rollback(self):
method __call__ (line 333) | def __call__(self, *args, **kwargs):
method __repr__ (line 336) | def __repr__(self):
method __del__ (line 339) | def __del__(self):
method batch (line 346) | def batch(self):
class DatabaseTransaction (line 354) | class DatabaseTransaction(Database):
method __init__ (line 356) | def __init__(self, name, **kwargs):
method execute (line 365) | def execute(self, sql, values=()):
method commit (line 368) | def commit(self):
method rollback (line 380) | def rollback(self):
method __len__ (line 383) | def __len__(self):
method __call__ (line 386) | def __call__(self, *args, **kwargs):
method __repr__ (line 389) | def __repr__(self):
method batch (line 393) | def batch(self):
function pbkdf2 (line 399) | def pbkdf2(s, salt, iterations=10000, n=32, f="sha256"):
function streql (line 422) | def streql(s1, s2):
function encode_password (line 434) | def encode_password(s):
function verify_password (line 443) | def verify_password(s1, s2):
class RateLimitError (line 483) | class RateLimitError(Exception):
class RateLimitExceeded (line 487) | class RateLimitExceeded(RateLimitError):
class RateLimitForbidden (line 491) | class RateLimitForbidden(RateLimitError):
class RateLimit (line 495) | class RateLimit(Database):
method __init__ (line 497) | def __init__(self, name="rate.db", **kwargs):
method cache (line 518) | def cache(self):
method lock (line 522) | def lock(self):
method key (line 526) | def key(self, pairs=("rA", "aZ", "gQ", "hH", "hG", "aR", "DD"), n=32):
method reset (line 534) | def reset(self):
method load (line 538) | def load(self):
method set (line 549) | def set(self, key, path="/", limit=100, time=HOUR):
method get (line 567) | def get(self, key, path="/"):
method delete (line 574) | def delete(self, key, path="/"):
method __setitem__ (line 584) | def __setitem__(self, k, v): # (key, path), (limit, time)
method __getitem__ (line 587) | def __getitem__(self, k): # (key, path)
method __delitem__ (line 590) | def __delitem__(self, k): # (key, path)
method __contains__ (line 593) | def __contains__(self, key, path="%"):
method __call__ (line 599) | def __call__(self, key, path="/", limit=None, time=None, ip=None, rese...
method count (line 633) | def count(self, key, path="/"):
class RouteError (line 645) | class RouteError(Exception):
class Router (line 649) | class Router(dict):
method __init__ (line 651) | def __init__(self):
method __setitem__ (line 656) | def __setitem__(self, path, handler):
method __call__ (line 673) | def __call__(self, path, **data):
class HTTPRequest (line 716) | class HTTPRequest(object):
method __init__ (line 718) | def __init__(self, app, ip, path="/", method="get", data={}, headers={}):
method __repr__ (line 728) | def __repr__(self):
class HTTPRedirect (line 732) | class HTTPRedirect(Exception):
method __init__ (line 734) | def __init__(self, url, code=303):
method __repr__ (line 740) | def __repr__(self):
class HTTPError (line 744) | class HTTPError(Exception):
method __init__ (line 746) | def __init__(self, status="", message="", traceback=""):
method __repr__ (line 754) | def __repr__(self):
function _HTTPErrorSubclass (line 758) | def _HTTPErrorSubclass(status):
class localdict (line 791) | class localdict(dict):
method __init__ (line 793) | def __init__(self, data=None, **kwargs):
method items (line 799) | def items(self):
method keys (line 802) | def keys(self):
method values (line 805) | def values(self):
method update (line 808) | def update(self, d):
method clear (line 811) | def clear(self):
method pop (line 814) | def pop(self, *kv):
method setdefault (line 817) | def setdefault(self, k, v=None):
method set (line 820) | def set(self, k, v):
method get (line 823) | def get(self, k, default=None):
method __delitem__ (line 826) | def __delitem__(self, k):
method __getitem__ (line 829) | def __getitem__(self, k):
method __setitem__ (line 832) | def __setitem__(self, k, v):
method __delattr__ (line 835) | def __delattr__(self, k):
method __getattr__ (line 838) | def __getattr__(self, k):
method __setattr__ (line 841) | def __setattr__(self, k, v):
method __len__ (line 844) | def __len__(self):
method __iter__ (line 847) | def __iter__(self):
method __contains__ (line 850) | def __contains__(self, k):
method __str__ (line 853) | def __str__(self):
method __repr__ (line 856) | def __repr__(self):
function threadsafe (line 864) | def threadsafe(function):
class ApplicationError (line 897) | class ApplicationError(Exception):
class Application (line 901) | class Application(object):
method __init__ (line 903) | def __init__(self, name=None, path=SCRIPT, static="./static", rate="ra...
method owner (line 932) | def owner(self):
method name (line 936) | def name(self):
method host (line 940) | def host(self):
method port (line 944) | def port(self):
method up (line 948) | def up(self):
method path (line 954) | def path(self):
method static (line 960) | def static(self):
method session (line 966) | def session(self):
method request (line 972) | def request(self):
method response (line 986) | def response(self):
method elapsed (line 993) | def elapsed(self):
method _cast (line 998) | def _cast(self, v):
method default (line 1026) | def default(self, *path, **data):
method route (line 1060) | def route(self, path, limit=False, time=None, key=lambda data: data.ge...
method error (line 1103) | def error(self, code="*"):
method view (line 1128) | def view(self, template, cached=True):
class Thread (line 1145) | class Thread(localdict):
method __init__ (line 1150) | def __init__(self):
method __call__ (line 1153) | def __call__(self, event=START): # START / STOP
method rate (line 1166) | def rate(self, name="rate"):
method bind (line 1173) | def bind(self, name="db"):
method __getattr__ (line 1195) | def __getattr__(self, k):
method cached (line 1205) | def cached(self):
method task (line 1232) | def task(self, interval=MINUTE):
method redirect (line 1252) | def redirect(path, code=303):
method run (line 1258) | def run(self, host=LOCALHOST, port=8080, threads=30, queue=20, timeout...
method stop (line 1325) | def stop(self):
method __call__ (line 1339) | def __call__(self, *args, **kwargs):
function certificate (line 1355) | def certificate(domain=LOCALHOST, country=None, state=None, city=None, c...
function redirect (line 1434) | def redirect(path, code=303):
function static (line 1443) | def static(path, root=None, mimetype=None):
function _register (line 1455) | def _register(event, handler):
function _request_start (line 1463) | def _request_start():
function _request_end (line 1468) | def _request_end():
class Template (line 1503) | class Template(object):
method __init__ (line 1507) | def __init__(self, path, root=None, cached=True):
method _escape (line 1528) | def _escape(self, s):
method _encode (line 1536) | def _encode(self, v, indent=""):
method _dict (line 1544) | def _dict(self, k="", v=[]):
method _compile (line 1554) | def _compile(self, string):
method _render (line 1598) | def _render(self, compiled, *args, **kwargs):
method render (line 1632) | def render(self, *args, **kwargs):
function template (line 1645) | def template(string, *args, **kwargs):
class HTML (line 1677) | class HTML:
method _attrs (line 1679) | def _attrs(self, **kwargs):
method div (line 1694) | def div(self, content, **attributes):
method span (line 1699) | def span(self, content, **attributes):
method table (line 1704) | def table(self, rows=[], headers=[], striped=True, **attributes):
method select (line 1728) | def select(self, options={}, selected=None, **attributes):
FILE: pattern/text/__init__.py
function ngrams (line 54) | def ngrams(string, n=3, punctuation=PUNCTUATION, continuous=False):
function split_document_by_delimeters (line 82) | def split_document_by_delimeters(string, regexp="[.,!?;: ]", min_word_le...
function train_topmine_ngrammer (line 97) | def train_topmine_ngrammer(documents, threshhold=1, max_ngramm_len=3, mi...
function topmine_ngramms (line 124) | def topmine_ngramms(doc, ng, threshhold=1):
class NGrammer (line 139) | class NGrammer(object):
method __init__ (line 145) | def __init__(self, regexp):
method delimiters (line 153) | def delimiters(self):
method delimiters (line 157) | def delimiters(self, value):
method delimiters_regex (line 161) | def delimiters_regex(self):
method delimiters_regex (line 165) | def delimiters_regex(self, value):
method lengthInWords (line 169) | def lengthInWords(self):
method lengthInWords (line 173) | def lengthInWords(self, value):
method frequentPhraseMining (line 176) | def frequentPhraseMining(self, document_list, threshhold, max_ngramm_l...
method _significanceScore (line 225) | def _significanceScore(self, ngramm1, ngramm2):
method ngramm (line 232) | def ngramm(self, token_list, threshhold, indexes=[]):
method removeDelimiters (line 278) | def removeDelimiters(self, ngramm_list, indexes=[]):
method saveAsJson (line 296) | def saveAsJson(self, filename, with_delimiters=False):
method loadFromJson (line 305) | def loadFromJson(self, filename, with_delimiters=False):
function deflood (line 319) | def deflood(s, n=3):
function decamel (line 329) | def decamel(s, separator="_"):
function pprint (line 340) | def pprint(string, token=[WORD, POS, CHUNK, PNP], column=4):
class lazydict (line 356) | class lazydict(dict):
method load (line 358) | def load(self):
method _lazy (line 363) | def _lazy(self, method, *args):
method __repr__ (line 372) | def __repr__(self):
method __len__ (line 375) | def __len__(self):
method __iter__ (line 378) | def __iter__(self):
method __contains__ (line 381) | def __contains__(self, *args):
method __getitem__ (line 384) | def __getitem__(self, *args):
method __setitem__ (line 387) | def __setitem__(self, *args):
method __delitem__ (line 390) | def __delitem__(self, *args):
method setdefault (line 393) | def setdefault(self, *args):
method get (line 396) | def get(self, *args, **kwargs):
method items (line 399) | def items(self):
method keys (line 402) | def keys(self):
method values (line 405) | def values(self):
method update (line 408) | def update(self, *args):
method pop (line 411) | def pop(self, *args):
method popitem (line 414) | def popitem(self, *args):
class lazylist (line 420) | class lazylist(list):
method load (line 422) | def load(self):
method _lazy (line 427) | def _lazy(self, method, *args):
method __repr__ (line 436) | def __repr__(self):
method __len__ (line 439) | def __len__(self):
method __iter__ (line 442) | def __iter__(self):
method __contains__ (line 445) | def __contains__(self, *args):
method __getitem__ (line 448) | def __getitem__(self, *args):
method __setitem__ (line 451) | def __setitem__(self, *args):
method __delitem__ (line 454) | def __delitem__(self, *args):
method insert (line 457) | def insert(self, *args):
method append (line 460) | def append(self, *args):
method extend (line 463) | def extend(self, *args):
method remove (line 466) | def remove(self, *args):
method pop (line 469) | def pop(self, *args):
method index (line 472) | def index(self, *args):
method count (line 475) | def count(self, *args):
class lazyset (line 481) | class lazyset(set):
method load (line 483) | def load(self):
method _lazy (line 488) | def _lazy(self, method, *args):
method __repr__ (line 498) | def __repr__(self):
method __len__ (line 501) | def __len__(self):
method __iter__ (line 504) | def __iter__(self):
method __contains__ (line 507) | def __contains__(self, *args):
method __sub__ (line 510) | def __sub__(self, *args):
method __and__ (line 513) | def __and__(self, *args):
method __or__ (line 516) | def __or__(self, *args):
method __xor__ (line 519) | def __xor__(self, *args):
method __isub__ (line 522) | def __isub__(self, *args):
method __iand__ (line 525) | def __iand__(self, *args):
method __ior__ (line 528) | def __ior__(self, *args):
method __ixor__ (line 531) | def __ixor__(self, *args):
method __gt__ (line 534) | def __gt__(self, *args):
method __lt__ (line 537) | def __lt__(self, *args):
method __gte__ (line 540) | def __gte__(self, *args):
method __lte__ (line 543) | def __lte__(self, *args):
method add (line 546) | def add(self, *args):
method pop (line 549) | def pop(self, *args):
method remove (line 552) | def remove(self, *args):
method discard (line 555) | def discard(self, *args):
method isdisjoint (line 558) | def isdisjoint(self, *args):
method issubset (line 561) | def issubset(self, *args):
method issuperset (line 564) | def issuperset(self, *args):
method union (line 567) | def union(self, *args):
method intersection (line 570) | def intersection(self, *args):
method difference (line 573) | def difference(self, *args):
function _read (line 588) | def _read(path, encoding="utf-8", comment=";;;"):
class Lexicon (line 612) | class Lexicon(lazydict):
method __init__ (line 614) | def __init__(self, path=""):
method path (line 620) | def path(self):
method load (line 623) | def load(self):
class Frequency (line 630) | class Frequency(lazydict):
method __init__ (line 632) | def __init__(self, path=""):
method path (line 638) | def path(self):
method load (line 641) | def load(self):
class Model (line 659) | class Model(object):
method __init__ (line 661) | def __init__(self, path="", classifier=None, known=set(), unknown=set()):
method path (line 682) | def path(self):
method load (line 686) | def load(self, path="", lexicon={}):
method save (line 689) | def save(self, path, final=True):
method train (line 693) | def train(self, token, tag, previous=None, next=None):
method classify (line 699) | def classify(self, token, previous=None, next=None, **kwargs):
method apply (line 705) | def apply(self, token, previous=(None, None), next=(None, None)):
method _v (line 711) | def _v(self, token, previous=None, next=None):
method _get_description (line 731) | def _get_description(self):
method _set_description (line 734) | def _set_description(self, s):
class Morphology (line 745) | class Morphology(lazylist):
method __init__ (line 747) | def __init__(self, path="", known={}):
method path (line 767) | def path(self):
method load (line 770) | def load(self):
method apply (line 774) | def apply(self, token, previous=(None, None), next=(None, None)):
method insert (line 798) | def insert(self, i, tag, affix, cmd="hassuf", tagged=None):
method append (line 814) | def append(self, *args, **kwargs):
method extend (line 817) | def extend(self, rules=[]):
class Context (line 826) | class Context(lazylist):
method __init__ (line 828) | def __init__(self, path=""):
method path (line 863) | def path(self):
method load (line 866) | def load(self):
method apply (line 870) | def apply(self, tokens):
method insert (line 912) | def insert(self, i, tag1, tag2, cmd="prevtag", x=None, y=None):
method append (line 924) | def append(self, *args, **kwargs):
method extend (line 927) | def extend(self, rules=[]):
class Entities (line 938) | class Entities(lazydict):
method __init__ (line 940) | def __init__(self, path="", tag="NNP"):
method path (line 953) | def path(self):
method load (line 956) | def load(self):
method apply (line 963) | def apply(self, tokens):
method append (line 994) | def append(self, entity, name="pers"):
method extend (line 1001) | def extend(self, entities):
class Parser (line 1042) | class Parser(object):
method __init__ (line 1044) | def __init__(self, lexicon={}, frequency={}, model=None, morphology=No...
method find_keywords (line 1087) | def find_keywords(self, string, **kwargs):
method find_tokens (line 1096) | def find_tokens(self, string, **kwargs):
method find_tags (line 1107) | def find_tags(self, tokens, **kwargs):
method find_chunks (line 1122) | def find_chunks(self, tokens, **kwargs):
method find_prepositions (line 1132) | def find_prepositions(self, tokens, **kwargs):
method find_labels (line 1137) | def find_labels(self, tokens, **kwargs):
method find_lemmata (line 1142) | def find_lemmata(self, tokens, **kwargs):
method parse (line 1147) | def parse(self, s, tokenize=True, tags=True, chunks=True, relations=Fa...
class TaggedString (line 1221) | class TaggedString(str):
method __new__ (line 1223) | def __new__(self, string, tags=["word"], language=None):
method split (line 1239) | def split(self, sep=TOKENS):
function penntreebank2universal (line 1270) | def penntreebank2universal(token, tag):
function find_tokens (line 1385) | def find_tokens(string, punctuation=PUNCTUATION, abbreviations=ABBREVIAT...
function _suffix_rules (line 1473) | def _suffix_rules(token, tag="NN"):
function find_tags (line 1493) | def find_tags(tokens, lexicon={}, model=None, morphology=None, context=N...
function find_chunks (line 1593) | def find_chunks(tagged, language="en"):
function find_prepositions (line 1641) | def find_prepositions(chunked):
function find_relations (line 1674) | def find_relations(chunked):
function find_keywords (line 1728) | def find_keywords(string, parser, top=10, frequency={}, ignore=("rt",), ...
function commandline (line 1833) | def commandline(parse=Parser().parse):
function tense_id (line 2051) | def tense_id(*args, **kwargs):
class Verbs (line 2110) | class Verbs(lazydict):
method __init__ (line 2112) | def __init__(self, path="", format=[], default={}, language=None):
method load (line 2124) | def load(self):
method path (line 2134) | def path(self):
method language (line 2138) | def language(self):
method infinitives (line 2142) | def infinitives(self):
method inflections (line 2150) | def inflections(self):
method TENSES (line 2158) | def TENSES(self):
method lemma (line 2168) | def lemma(self, verb, parse=True):
method lexeme (line 2180) | def lexeme(self, verb, parse=True):
method conjugate (line 2193) | def conjugate(self, verb, *args, **kwargs):
method tenses (line 2222) | def tenses(self, verb, parse=True):
method find_lemma (line 2256) | def find_lemma(self, verb):
method find_lexeme (line 2261) | def find_lexeme(self, verb):
class Tenses (line 2267) | class Tenses(list):
method __contains__ (line 2269) | def __contains__(self, tense):
function avg (line 2301) | def avg(list):
class Score (line 2305) | class Score(tuple):
method __new__ (line 2307) | def __new__(self, polarity, subjectivity, assessments=[]):
method __init__ (line 2312) | def __init__(self, polarity, subjectivity, assessments=[]):
class Sentiment (line 2316) | class Sentiment(lazydict):
method __init__ (line 2318) | def __init__(self, path="", language=None, synset=None, confidence=Non...
method path (line 2337) | def path(self):
method language (line 2341) | def language(self):
method confidence (line 2345) | def confidence(self):
method load (line 2348) | def load(self, path=None):
method synset (line 2394) | def synset(self, id, pos=ADJECTIVE):
method __call__ (line 2416) | def __call__(self, s, negation=True, ngrams=DEFAULT, **kwargs):
method assessments (line 2475) | def assessments(self, words=[], negation=True, ngrams=DEFAULT):
method annotate (line 2567) | def annotate(self, word, pos=None, polarity=0.0, subjectivity=0.0, int...
method save (line 2576) | def save(self, path):
class Spelling (line 2605) | class Spelling(lazydict):
method __init__ (line 2613) | def __init__(self, path="", alphabet='LATIN'):
method load (line 2620) | def load(self):
method path (line 2626) | def path(self):
method language (line 2630) | def language(self):
method train (line 2634) | def train(self, s, path="spelling.txt"):
method _edit1 (line 2647) | def _edit1(self, w):
method _edit2 (line 2661) | def _edit2(self, w):
method _known (line 2668) | def _known(self, words=[]):
method suggest (line 2673) | def suggest(self, w):
function _module (line 2707) | def _module(language):
function _multilingual (line 2717) | def _multilingual(function, *args, **kwargs):
function language (line 2724) | def language(s):
function tokenize (line 2739) | def tokenize(*args, **kwargs):
function parse (line 2743) | def parse(*args, **kwargs):
function parsetree (line 2747) | def parsetree(*args, **kwargs):
function split (line 2751) | def split(*args, **kwargs):
function tag (line 2755) | def tag(*args, **kwargs):
function keywords (line 2759) | def keywords(*args, **kwargs):
function suggest (line 2763) | def suggest(*args, **kwargs):
function sentiment (line 2767) | def sentiment(*args, **kwargs):
function singularize (line 2771) | def singularize(*args, **kwargs):
function pluralize (line 2775) | def pluralize(*args, **kwargs):
function conjugate (line 2779) | def conjugate(*args, **kwargs):
function predicative (line 2783) | def predicative(*args, **kwargs):
function suggest (line 2787) | def suggest(*args, **kwargs):
FILE: pattern/text/de/__init__.py
function stts2penntreebank (line 159) | def stts2penntreebank(token, tag):
function stts2universal (line 166) | def stts2universal(token, tag):
function find_lemmata (line 193) | def find_lemmata(tokens):
class Parser (line 209) | class Parser(_Parser):
method find_tokens (line 211) | def find_tokens(self, tokens, **kwargs):
method find_lemmata (line 216) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 219) | def find_tags(self, tokens, **kwargs):
function tokenize (line 248) | def tokenize(s, *args, **kwargs):
function parse (line 254) | def parse(s, *args, **kwargs):
function parsetree (line 260) | def parsetree(s, *args, **kwargs):
function tree (line 266) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 272) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 282) | def keywords(s, top=10, **kwargs):
function suggest (line 292) | def suggest(w):
FILE: pattern/text/de/inflect.py
function definite_article (line 90) | def definite_article(word, gender=MALE, role=SUBJECT):
function indefinite_article (line 96) | def indefinite_article(word, gender=MALE, role=SUBJECT):
function article (line 105) | def article(word, function=INDEFINITE, gender=MALE, role=SUBJECT):
function referenced (line 114) | def referenced(word, article=INDEFINITE, gender=MALE, role=SUBJECT):
function gender (line 154) | def gender(word, pos=NOUN):
function pluralize (line 220) | def pluralize(word, pos=NOUN, gender=MALE, role=SUBJECT, custom={}):
function singularize (line 326) | def singularize(word, pos=NOUN, gender=MALE, role=SUBJECT, custom={}):
function encode_sz (line 368) | def encode_sz(s):
function decode_sz (line 372) | def decode_sz(s):
class Verbs (line 376) | class Verbs(_Verbs):
method __init__ (line 378) | def __init__(self):
method find_lemma (line 385) | def find_lemma(self, verb):
method find_lexeme (line 430) | def find_lexeme(self, verb):
method tenses (line 481) | def tenses(self, verb, parse=True):
function attributive (line 533) | def attributive(adjective, gender=MALE, role=SUBJECT, article=None):
function predicative (line 560) | def predicative(adjective):
function grade (line 586) | def grade(adjective, suffix=COMPARATIVE):
function comparative (line 597) | def comparative(adjective):
function superlative (line 601) | def superlative(adjective):
FILE: pattern/text/en/__init__.py
function find_lemmata (line 88) | def find_lemmata(tokens):
class Parser (line 104) | class Parser(_Parser):
method find_lemmata (line 106) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 109) | def find_tags(self, tokens, **kwargs):
class Sentiment (line 117) | class Sentiment(_Sentiment):
method load (line 119) | def load(self, path=None):
function tokenize (line 160) | def tokenize(s, *args, **kwargs):
function parse (line 166) | def parse(s, *args, **kwargs):
function parsetree (line 172) | def parsetree(s, *args, **kwargs):
function tree (line 178) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 184) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 194) | def keywords(s, top=10, **kwargs):
function suggest (line 204) | def suggest(w):
function polarity (line 210) | def polarity(s, **kwargs):
function subjectivity (line 216) | def subjectivity(s, **kwargs):
function positive (line 222) | def positive(s, threshold=0.1, **kwargs):
FILE: pattern/text/en/inflect.py
function definite_article (line 77) | def definite_article(word):
function indefinite_article (line 81) | def indefinite_article(word):
function article (line 94) | def article(word, function=INDEFINITE):
function referenced (line 102) | def referenced(word, article=INDEFINITE):
function pluralize (line 397) | def pluralize(word, pos=NOUN, custom={}, classical=True):
function singularize (line 602) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 641) | class Verbs(_Verbs):
method __init__ (line 643) | def __init__(self):
method find_lemma (line 658) | def find_lemma(self, verb):
method find_lexeme (line 709) | def find_lexeme(self, verb):
function _count_syllables (line 769) | def _count_syllables(word):
function grade (line 781) | def grade(adjective, suffix=COMPARATIVE):
function comparative (line 814) | def comparative(adjective):
function superlative (line 818) | def superlative(adjective):
function attributive (line 824) | def attributive(adjective):
function predicative (line 828) | def predicative(adjective):
FILE: pattern/text/en/inflect_quantify.py
function zshift (line 88) | def zshift(s):
function number (line 104) | def number(s):
function numerals (line 171) | def numerals(n, round=2):
function approximate (line 259) | def approximate(word, amount=1, plural={}):
function count (line 317) | def count(*args, **kwargs):
function reflect (line 379) | def reflect(object, quantify=True, replace=readable_types):
FILE: pattern/text/en/modality.py
function find (line 18) | def find(function, list):
function s (line 34) | def s(word):
function join (line 38) | def join(words):
function question (line 42) | def question(sentence):
function verb (line 46) | def verb(word):
function verbs (line 50) | def verbs(sentence, i=0, j=None):
function imperative (line 54) | def imperative(sentence, **kwargs):
function conditional (line 114) | def conditional(sentence, predictive=True, **kwargs):
function subjunctive (line 182) | def subjunctive(sentence, classical=True, **kwargs):
function negated (line 240) | def negated(sentence, negative=("not", "n't", "never")):
function mood (line 251) | def mood(sentence, **kwargs):
function d (line 275) | def d(*args):
function modality (line 413) | def modality(sentence, type=EPISTEMIC):
function uncertain (line 472) | def uncertain(sentence, threshold=0.5):
FILE: pattern/text/en/wordlist/__init__.py
class Wordlist (line 26) | class Wordlist(object):
method __init__ (line 28) | def __init__(self, name, data=[]):
method _load (line 34) | def _load(self):
method __repr__ (line 38) | def __repr__(self):
method __iter__ (line 42) | def __iter__(self):
method __len__ (line 46) | def __len__(self):
method __contains__ (line 50) | def __contains__(self, w):
method __add__ (line 54) | def __add__(self, iterable):
method __getitem__ (line 58) | def __getitem__(self, i):
method __setitem__ (line 62) | def __setitem__(self, i, v):
method insert (line 66) | def insert(self, i, v):
method append (line 70) | def append(self, v):
method extend (line 74) | def extend(self, v):
FILE: pattern/text/en/wordnet/__init__.py
function normalize (line 92) | def normalize(word):
function synsets (line 128) | def synsets(word, pos=NOUN):
class _synset (line 151) | class _synset(lazydict):
method __getitem__ (line 153) | def __getitem__(self, k):
class Synset (line 164) | class Synset(object):
method __init__ (line 166) | def __init__(self, synset):
method __iter__ (line 183) | def __iter__(self):
method __len__ (line 187) | def __len__(self):
method __getitem__ (line 190) | def __getitem__(self, i):
method __eq__ (line 193) | def __eq__(self, synset):
method __ne__ (line 196) | def __ne__(self, synset):
method id (line 201) | def id(self):
method pos (line 205) | def pos(self):
method synonyms (line 221) | def synonyms(self):
method gloss (line 230) | def gloss(self):
method lexname (line 236) | def lexname(self):
method antonym (line 242) | def antonym(self):
method meronyms (line 249) | def meronyms(self):
method holonyms (line 261) | def holonyms(self):
method hyponyms (line 269) | def hyponyms(self, recursive=False, depth=None):
method hypernyms (line 293) | def hypernyms(self, recursive=False, depth=None):
method hypernym (line 308) | def hypernym(self):
method similar (line 315) | def similar(self):
method similarity (line 325) | def similarity(self, synset):
method ic (line 334) | def ic(self):
method weight (line 343) | def weight(self):
function similarity (line 349) | def similarity(synset1, synset2):
function ancestor (line 355) | def ancestor(synset1, synset2):
function map32 (line 408) | def map32(id, pos=NOUN):
class Sentiment (line 433) | class Sentiment(object):
class SentiWordNet (line 439) | class SentiWordNet(Sentiment):
method __init__ (line 441) | def __init__(self, path=None, language="en"):
method load (line 448) | def load(self):
method synset (line 451) | def synset(self, id, pos=ADJECTIVE):
method __getitem__ (line 465) | def __getitem__(self, k):
method assessments (line 474) | def assessments(self, words=[], negation=True):
method __call__ (line 477) | def __call__(self, s, negation=True):
class sentiment (line 490) | class sentiment(object):
method load (line 492) | def load(self, **kwargs):
method __getitem__ (line 495) | def __getitem__(self, w):
method __contains__ (line 499) | def __contains__(self, w):
FILE: pattern/text/es/__init__.py
function parole2penntreebank (line 146) | def parole2penntreebank(token, tag):
function parole2universal (line 153) | def parole2universal(token, tag):
function find_lemmata (line 174) | def find_lemmata(tokens):
class Parser (line 192) | class Parser(_Parser):
method find_tokens (line 194) | def find_tokens(self, tokens, **kwargs):
method find_lemmata (line 199) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 202) | def find_tags(self, tokens, **kwargs):
function tokenize (line 227) | def tokenize(s, *args, **kwargs):
function parse (line 233) | def parse(s, *args, **kwargs):
function parsetree (line 239) | def parsetree(s, *args, **kwargs):
function tree (line 245) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 251) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 261) | def keywords(s, top=10, **kwargs):
function suggest (line 271) | def suggest(w):
FILE: pattern/text/es/inflect.py
function normalize (line 58) | def normalize(vowel):
function definite_article (line 70) | def definite_article(word, gender=MALE):
function indefinite_article (line 78) | def indefinite_article(word, gender=MALE):
function article (line 89) | def article(word, function=INDEFINITE, gender=MALE):
function referenced (line 98) | def referenced(word, article=INDEFINITE, gender=MALE):
function pluralize (line 113) | def pluralize(word, pos=NOUN, custom={}):
function singularize (line 174) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 262) | class Verbs(_Verbs):
method __init__ (line 264) | def __init__(self):
method find_lemma (line 279) | def find_lemma(self, verb):
method find_lexeme (line 351) | def find_lexeme(self, verb):
function attributive (line 392) | def attributive(adjective, gender=MALE):
function predicative (line 418) | def predicative(adjective):
FILE: pattern/text/fr/__init__.py
function penntreebank2universal (line 91) | def penntreebank2universal(token, tag):
function find_lemmata (line 126) | def find_lemmata(tokens):
class Parser (line 146) | class Parser(_Parser):
method find_tokens (line 148) | def find_tokens(self, tokens, **kwargs):
method find_lemmata (line 155) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 158) | def find_tags(self, tokens, **kwargs):
class Sentiment (line 166) | class Sentiment(_Sentiment):
method load (line 168) | def load(self, path=None):
function tokenize (line 210) | def tokenize(s, *args, **kwargs):
function parse (line 216) | def parse(s, *args, **kwargs):
function parsetree (line 222) | def parsetree(s, *args, **kwargs):
function tree (line 228) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 234) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 244) | def keywords(s, top=10, **kwargs):
function suggest (line 254) | def suggest(w):
function polarity (line 260) | def polarity(s, **kwargs):
function subjectivity (line 266) | def subjectivity(s, **kwargs):
function positive (line 272) | def positive(s, threshold=0.1, **kwargs):
FILE: pattern/text/fr/inflect.py
function pluralize (line 67) | def pluralize(word, pos=NOUN, custom={}):
function singularize (line 89) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 162) | class Verbs(_Verbs):
method __init__ (line 164) | def __init__(self):
method find_lemma (line 179) | def find_lemma(self, verb):
method find_lexeme (line 191) | def find_lexeme(self, verb):
function attributive (line 262) | def attributive(adjective):
function predicative (line 269) | def predicative(adjective):
FILE: pattern/text/it/__init__.py
function penntreebank2universal (line 88) | def penntreebank2universal(token, tag):
function find_lemmata (line 122) | def find_lemmata(tokens):
class Parser (line 140) | class Parser(_Parser):
method find_tokens (line 142) | def find_tokens(self, tokens, **kwargs):
method find_lemmata (line 151) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 154) | def find_tags(self, tokens, **kwargs):
class Sentiment (line 162) | class Sentiment(_Sentiment):
method load (line 164) | def load(self, path=None):
function tokenize (line 193) | def tokenize(s, *args, **kwargs):
function parse (line 199) | def parse(s, *args, **kwargs):
function parsetree (line 205) | def parsetree(s, *args, **kwargs):
function tree (line 211) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 217) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 227) | def keywords(s, top=10, **kwargs):
function suggest (line 237) | def suggest(w):
function polarity (line 243) | def polarity(s, **kwargs):
function subjectivity (line 249) | def subjectivity(s, **kwargs):
function positive (line 255) | def positive(s, threshold=0.1, **kwargs):
FILE: pattern/text/it/inflect.py
function definite_article (line 71) | def definite_article(word, gender=MALE):
function indefinite_article (line 87) | def indefinite_article(word, gender=MALE):
function article (line 104) | def article(word, function=INDEFINITE, gender=MALE):
function referenced (line 114) | def referenced(word, article=INDEFINITE, gender=MALE):
function gender (line 125) | def gender(word):
function pluralize (line 174) | def pluralize(word, pos=NOUN, custom={}):
function singularize (line 226) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 291) | class Verbs(_Verbs):
method __init__ (line 293) | def __init__(self):
method find_lemma (line 308) | def find_lemma(self, verb):
method find_lexeme (line 365) | def find_lexeme(self, verb):
function attributive (line 436) | def attributive(adjective):
function predicative (line 443) | def predicative(adjective):
FILE: pattern/text/nl/__init__.py
function wotan2penntreebank (line 97) | def wotan2penntreebank(token, tag):
function wotan2universal (line 109) | def wotan2universal(token, tag):
function find_lemmata (line 126) | def find_lemmata(tokens):
class Parser (line 142) | class Parser(_Parser):
method find_tokens (line 144) | def find_tokens(self, tokens, **kwargs):
method find_lemmata (line 152) | def find_lemmata(self, tokens, **kwargs):
method find_tags (line 155) | def find_tags(self, tokens, **kwargs):
class Sentiment (line 165) | class Sentiment(_Sentiment):
method load (line 167) | def load(self, path=None):
function tokenize (line 202) | def tokenize(s, *args, **kwargs):
function parse (line 208) | def parse(s, *args, **kwargs):
function parsetree (line 214) | def parsetree(s, *args, **kwargs):
function tree (line 220) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 226) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 236) | def keywords(s, top=10, **kwargs):
function suggest (line 246) | def suggest(w):
function polarity (line 252) | def polarity(s, **kwargs):
function subjectivity (line 258) | def subjectivity(s, **kwargs):
function positive (line 264) | def positive(s, threshold=0.1, **kwargs):
FILE: pattern/text/nl/inflect.py
function pluralize (line 79) | def pluralize(word, pos=NOUN, custom={}):
function singularize (line 150) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 228) | class Verbs(_Verbs):
method __init__ (line 230) | def __init__(self):
method load (line 245) | def load(self):
method find_lemma (line 253) | def find_lemma(self, verb):
method find_lexeme (line 310) | def find_lexeme(self, verb):
function attributive (line 368) | def attributive(adjective):
function predicative (line 404) | def predicative(adjective):
FILE: pattern/text/ru/__init__.py
class Parser (line 55) | class Parser(_Parser):
method find_tags (line 57) | def find_tags(self, tokens, **kwargs):
function tokenize (line 82) | def tokenize(s, *args, **kwargs):
function parse (line 88) | def parse(s, *args, **kwargs):
function parsetree (line 94) | def parsetree(s, *args, **kwargs):
function suggest (line 100) | def suggest(w):
FILE: pattern/text/ru/wordlist/__init__.py
class Wordlist (line 26) | class Wordlist(object):
method __init__ (line 28) | def __init__(self, name, data=[]):
method _load (line 34) | def _load(self):
method __repr__ (line 38) | def __repr__(self):
method __iter__ (line 42) | def __iter__(self):
method __len__ (line 46) | def __len__(self):
method __contains__ (line 50) | def __contains__(self, w):
method __add__ (line 54) | def __add__(self, iterable):
method __getitem__ (line 58) | def __getitem__(self, i):
method __setitem__ (line 62) | def __setitem__(self, i, v):
method insert (line 66) | def insert(self, i, v):
method append (line 70) | def append(self, v):
method extend (line 74) | def extend(self, v):
FILE: pattern/text/search.py
class Text (line 38) | class Text(list):
method __init__ (line 40) | def __init__(self, string="", token=["word"]):
method sentences (line 46) | def sentences(self):
method words (line 50) | def words(self):
class Sentence (line 54) | class Sentence(list):
method __init__ (line 56) | def __init__(self, string="", token=["word"]):
method string (line 67) | def string(self):
method words (line 71) | def words(self):
method chunks (line 75) | def chunks(self):
class Word (line 79) | class Word(object):
method __init__ (line 81) | def __init__(self, sentence, string, tag=None, index=0):
method __repr__ (line 86) | def __repr__(self):
method _get_type (line 89) | def _get_type(self):
method _set_type (line 92) | def _set_type(self, v):
method chunk (line 98) | def chunk(self):
method lemma (line 102) | def lemma(self):
function _match (line 111) | def _match(string, pattern):
function unique (line 138) | def unique(iterable):
function find (line 145) | def find(function, iterable):
function combinations (line 153) | def combinations(iterable, n):
function product (line 158) | def product(*args, **kwargs):
function variations (line 183) | def variations(iterable, optional=lambda x: False):
class odict (line 213) | class odict(dict):
method __init__ (line 215) | def __init__(self, items=[]):
method fromkeys (line 226) | def fromkeys(cls, keys=[], v=None):
method push (line 229) | def push(self, kv):
method __iter__ (line 238) | def __iter__(self):
method __setitem__ (line 241) | def __setitem__(self, k, v):
method __delitem__ (line 246) | def __delitem__(self, k):
method update (line 250) | def update(self, d):
method setdefault (line 254) | def setdefault(self, k, v=None):
method pop (line 259) | def pop(self, k, *args, **kwargs):
method popitem (line 264) | def popitem(self):
method clear (line 268) | def clear(self):
method iterkeys (line 272) | def iterkeys(self):
method itervalues (line 275) | def itervalues(self):
method iteritems (line 278) | def iteritems(self):
method keys (line 281) | def keys(self):
method values (line 284) | def values(self):
method items (line 287) | def items(self):
method copy (line 290) | def copy(self):
method __repr__ (line 293) | def __repr__(self):
class Taxonomy (line 299) | class Taxonomy(dict):
method __init__ (line 301) | def __init__(self):
method _normalize (line 315) | def _normalize(self, term):
method __contains__ (line 321) | def __contains__(self, term):
method append (line 333) | def append(self, term, type=None, value=None):
method classify (line 344) | def classify(self, term, **kwargs):
method parents (line 360) | def parents(self, term, recursive=False, **kwargs):
method children (line 378) | def children(self, term, recursive=False, **kwargs):
method value (line 396) | def value(self, term, **kwargs):
method remove (line 407) | def remove(self, term):
class Classifier (line 429) | class Classifier(object):
method __init__ (line 431) | def __init__(self, parents=lambda term: [], children=lambda term: [], ...
class WordNetClassifier (line 447) | class WordNetClassifier(Classifier):
method __init__ (line 449) | def __init__(self, wordnet=None):
method _children (line 461) | def _children(self, word, pos="NN"):
method _parents (line 467) | def _parents(self, word, pos="NN"):
class Constraint (line 495) | class Constraint(object):
method __init__ (line 497) | def __init__(self, words=[], tags=[], chunks=[], roles=[], taxa=[], op...
method fromstring (line 519) | def fromstring(cls, s, **kwargs):
method _append (line 580) | def _append(self, v):
method match (line 603) | def match(self, word):
method __repr__ (line 687) | def __repr__(self):
method string (line 700) | def string(self):
class Pattern (line 716) | class Pattern(object):
method __init__ (line 718) | def __init__(self, sequence=[], *args, **kwargs):
method __iter__ (line 748) | def __iter__(self):
method __len__ (line 751) | def __len__(self):
method __getitem__ (line 754) | def __getitem__(self, i):
method fromstring (line 758) | def fromstring(cls, s, *args, **kwargs):
method scan (line 812) | def scan(self, string):
method search (line 831) | def search(self, sentence):
method match (line 853) | def match(self, sentence, start=0, _v=None, _u=None):
method _variations (line 882) | def _variations(self):
method _match (line 887) | def _match(self, sequence, sentence, start=0, i=0, w0=None, map=None, ...
method string (line 967) | def string(self):
function compile (line 974) | def compile(pattern, *args, **kwargs):
function scan (line 996) | def scan(pattern, string, *args, **kwargs):
function match (line 1003) | def match(pattern, sentence, *args, **kwargs):
function search (line 1009) | def search(pattern, sentence, *args, **kwargs):
function escape (line 1015) | def escape(string):
class Match (line 1026) | class Match(object):
method __init__ (line 1028) | def __init__(self, pattern, words=[], map={}):
method __len__ (line 1043) | def __len__(self):
method __iter__ (line 1046) | def __iter__(self):
method __getitem__ (line 1049) | def __getitem__(self, i):
method start (line 1053) | def start(self):
method stop (line 1057) | def stop(self):
method constraint (line 1060) | def constraint(self, word):
method constraints (line 1066) | def constraints(self, chunk):
method constituents (line 1074) | def constituents(self, constraint=None):
method group (line 1108) | def group(self, index, chunked=False):
method string (line 1125) | def string(self):
method __repr__ (line 1128) | def __repr__(self):
class Group (line 1134) | class Group(list):
method __init__ (line 1136) | def __init__(self, match, words):
method words (line 1141) | def words(self):
method start (line 1145) | def start(self):
method stop (line 1149) | def stop(self):
method string (line 1153) | def string(self):
FILE: pattern/text/tree.py
function find (line 68) | def find(function, iterable):
function intersects (line 76) | def intersects(iterable1, iterable2):
function unique (line 82) | def unique(iterable):
function zip (line 91) | def zip(*args, **kwargs):
function unzip (line 101) | def unzip(i, iterable):
class Map (line 107) | class Map(list):
method __init__ (line 112) | def __init__(self, function=lambda x: x, items=[]):
method items (line 117) | def items(self):
method __repr__ (line 120) | def __repr__(self):
method __getitem__ (line 123) | def __getitem__(self, i):
method __len__ (line 126) | def __len__(self):
method __iter__ (line 129) | def __iter__(self):
class Word (line 146) | class Word(object):
method __init__ (line 148) | def __init__(self, sentence, string, lemma=None, type=None, index=0):
method copy (line 170) | def copy(self, chunk=None, pnp=None):
method _get_tag (line 184) | def _get_tag(self):
method _set_tag (line 187) | def _set_tag(self, v):
method phrase (line 193) | def phrase(self):
method prepositional_phrase (line 197) | def prepositional_phrase(self):
method tags (line 203) | def tags(self):
method custom_tags (line 231) | def custom_tags(self):
method next (line 236) | def next(self, type=None):
method previous (line 246) | def previous(self, type=None):
method __getattr__ (line 257) | def __getattr__(self, tag):
method __str__ (line 265) | def __str__(self):
method __repr__ (line 268) | def __repr__(self):
method __eq__ (line 273) | def __eq__(self, word):
method __ne__ (line 276) | def __ne__(self, word):
class Tags (line 285) | class Tags(dict):
method __init__ (line 287) | def __init__(self, word, items=[]):
method __setitem__ (line 298) | def __setitem__(self, k, v):
method setdefault (line 305) | def setdefault(self, k, v):
class Chunk (line 313) | class Chunk(object):
method __init__ (line 315) | def __init__(self, sentence, words=[], type=None, role=None, relation=...
method extend (line 345) | def extend(self, words):
method append (line 349) | def append(self, word):
method __getitem__ (line 353) | def __getitem__(self, index):
method __len__ (line 356) | def __len__(self):
method __iter__ (line 359) | def __iter__(self):
method _get_tag (line 362) | def _get_tag(self):
method _set_tag (line 365) | def _set_tag(self, v):
method start (line 371) | def start(self):
method stop (line 375) | def stop(self):
method range (line 379) | def range(self):
method span (line 383) | def span(self):
method lemmata (line 387) | def lemmata(self):
method tagged (line 391) | def tagged(self):
method head (line 395) | def head(self):
method relation (line 415) | def relation(self):
method role (line 422) | def role(self):
method subject (line 429) | def subject(self):
method object (line 435) | def object(self):
method verb (line 441) | def verb(self):
method related (line 447) | def related(self):
method prepositional_phrase (line 454) | def prepositional_phrase(self):
method anchor_id (line 460) | def anchor_id(self):
method conjunctions (line 478) | def conjunctions(self):
method modifiers (line 484) | def modifiers(self):
method nearest (line 498) | def nearest(self, type="VP"):
method next (line 513) | def next(self, type=None):
method previous (line 523) | def previous(self, type=None):
method string (line 536) | def string(self):
method __str__ (line 539) | def __str__(self):
method __repr__ (line 542) | def __repr__(self):
method __eq__ (line 549) | def __eq__(self, chunk):
method __ne__ (line 552) | def __ne__(self, chunk):
class Chink (line 564) | class Chink(Chunk):
method __repr__ (line 565) | def __repr__(self):
class PNPChunk (line 571) | class PNPChunk(Chunk):
method __init__ (line 573) | def __init__(self, *args, **kwargs):
method append (line 585) | def append(self, word):
method preposition (line 594) | def preposition(self):
method phrases (line 603) | def phrases(self):
method guess_anchor (line 606) | def guess_anchor(self):
class Conjunctions (line 618) | class Conjunctions(list):
method __init__ (line 620) | def __init__(self, chunk):
method append (line 626) | def append(self, chunk, type=CONJUNCT):
function _uid (line 634) | def _uid():
function _is_tokenstring (line 640) | def _is_tokenstring(string):
class Sentence (line 647) | class Sentence(object):
method __init__ (line 649) | def __init__(self, string="", token=[WORD, POS, CHUNK, PNP, REL, ANCHO...
method word (line 684) | def word(self):
method lemmata (line 688) | def lemmata(self):
method parts_of_speech (line 695) | def parts_of_speech(self):
method tagged (line 702) | def tagged(self):
method phrases (line 706) | def phrases(self):
method prepositional_phrases (line 712) | def prepositional_phrases(self):
method start (line 718) | def start(self):
method stop (line 722) | def stop(self):
method nouns (line 726) | def nouns(self):
method verbs (line 730) | def verbs(self):
method adjectives (line 734) | def adjectives(self):
method subjects (line 738) | def subjects(self):
method objects (line 742) | def objects(self):
method verbs (line 746) | def verbs(self):
method anchors (line 750) | def anchors(self):
method is_question (line 754) | def is_question(self):
method is_exclamation (line 758) | def is_exclamation(self):
method __getitem__ (line 761) | def __getitem__(self, index):
method __len__ (line 764) | def __len__(self):
method __iter__ (line 767) | def __iter__(self):
method append (line 770) | def append(self, word, lemma=None, type=None, chunk=None, role=None, r...
method parse_token (line 792) | def parse_token(self, token, tags=[WORD, POS, CHUNK, PNP, REL, ANCHOR,...
method _parse_relation (line 862) | def _parse_relation(self, tag):
method _do_word (line 904) | def _do_word(self, word, lemma=None, type=None):
method _do_chunk (line 913) | def _do_chunk(self, type, role=None, relation=None, iob=None):
method _do_relation (line 933) | def _do_relation(self):
method _do_pnp (line 945) | def _do_pnp(self, pnp, anchor=None):
method _do_anchor (line 968) | def _do_anchor(self, anchor):
method _do_custom (line 986) | def _do_custom(self, custom):
method _do_conjunction (line 993) | def _do_conjunction(self, _and=("and", "e", "en", "et", "und", "y")):
method get (line 1007) | def get(self, index, tag=LEMMA):
method loop (line 1034) | def loop(self, *tags):
method indexof (line 1043) | def indexof(self, value, tag=WORD):
method slice (line 1057) | def slice(self, start, stop):
method copy (line 1091) | def copy(self):
method chunked (line 1094) | def chunked(self):
method constituents (line 1097) | def constituents(self, pnp=False):
method string (line 1116) | def string(self):
method __str__ (line 1119) | def __str__(self):
method __repr__ (line 1122) | def __repr__(self):
method __eq__ (line 1125) | def __eq__(self, other):
method xml (line 1136) | def xml(self):
method from_xml (line 1142) | def from_xml(cls, xml):
method nltk_tree (line 1150) | def nltk_tree(self):
class Slice (line 1156) | class Slice(Sentence):
method __init__ (line 1158) | def __init__(self, *args, **kwargs):
method start (line 1165) | def start(self):
method stop (line 1169) | def stop(self):
function chunked (line 1180) | def chunked(sentence):
class Text (line 1202) | class Text(list):
method __init__ (line 1204) | def __init__(self, string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, ...
method insert (line 1219) | def insert(self, index, sentence):
method append (line 1223) | def append(self, sentence):
method extend (line 1227) | def extend(self, sentences):
method remove (line 1232) | def remove(self, sentence):
method pop (line 1236) | def pop(self, index):
method sentences (line 1242) | def sentences(self):
method words (line 1246) | def words(self):
method copy (line 1249) | def copy(self):
method string (line 1257) | def string(self):
method __str__ (line 1260) | def __str__(self):
method xml (line 1267) | def xml(self):
method from_xml (line 1279) | def from_xml(cls, xml):
function tree (line 1289) | def tree(string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA]):
function xml (line 1298) | def xml(string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA]):
function xml_encode (line 1337) | def xml_encode(string):
function xml_decode (line 1348) | def xml_decode(string):
function parse_xml (line 1365) | def parse_xml(sentence, tab="\t", id=""):
class XML (line 1489) | class XML(object):
method __init__ (line 1490) | def __init__(self, string):
method __call__ (line 1494) | def __call__(self, tag):
class XMLNode (line 1500) | class XMLNode(object):
method __init__ (line 1501) | def __init__(self, element):
method tag (line 1505) | def tag(self):
method value (line 1509) | def value(self):
method __iter__ (line 1512) | def __iter__(self):
method __getitem__ (line 1515) | def __getitem__(self, k):
method get (line 1518) | def get(self, k, default=""):
class TaggedString (line 1532) | class TaggedString(str):
method __new__ (line 1533) | def __new__(cls, string, tags=["word"], language="en"):
function parse_string (line 1542) | def parse_string(xml):
function _parse_tokens (line 1593) | def _parse_tokens(chunk, format=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEM...
function _parse_relation (line 1641) | def _parse_relation(chunk, type="O"):
function _parse_token (line 1657) | def _parse_token(word, chunk="O", pnp="O", relation="O", anchor="O",
function nltk_tree (line 1686) | def nltk_tree(sentence):
function _colorize (line 1728) | def _colorize(x, colors):
function graphviz_dot (line 1740) | def graphviz_dot(sentence, font="Arial", colors=BLUE):
function table (line 1796) | def table(sentence, fill=1, placeholder="-"):
FILE: pattern/text/xx/__init__.py
function tagset2penntreebank (line 88) | def tagset2penntreebank(tag):
function find_lemmata (line 102) | def find_lemmata(tokens):
class Parser (line 120) | class Parser(_Parser):
method find_tokens (line 122) | def find_tokens(self, tokens, **kwargs):
method find_tags (line 127) | def find_tags(self, tokens, **kwargs):
method find_chunks (line 131) | def find_chunks(self, tokens, **kwargs):
method find_lemmata (line 134) | def find_lemmata(self, tokens, **kwargs):
function tokenize (line 175) | def tokenize(s, *args, **kwargs):
function parse (line 181) | def parse(s, *args, **kwargs):
function parsetree (line 187) | def parsetree(s, *args, **kwargs):
function tree (line 193) | def tree(s, token=[WORD, POS, CHUNK, PNP, REL, LEMMA]):
function tag (line 199) | def tag(s, tokenize=True, encoding="utf-8", **kwargs):
function keywords (line 209) | def keywords(s, top=10, **kwargs):
function polarity (line 219) | def polarity(s, **kwargs):
function subjectivity (line 225) | def subjectivity(s, **kwargs):
function positive (line 231) | def positive(s, threshold=0.1, **kwargs):
FILE: pattern/text/xx/inflect.py
function definite_article (line 60) | def definite_article(word):
function indefinite_article (line 66) | def indefinite_article(word):
function article (line 75) | def article(word, function=INDEFINITE):
function referenced (line 85) | def referenced(word, article=INDEFINITE):
function pluralize (line 93) | def pluralize(word, pos=NOUN, custom={}):
function singularize (line 101) | def singularize(word, pos=NOUN, custom={}):
class Verbs (line 110) | class Verbs(_Verbs):
method __init__ (line 112) | def __init__(self):
method find_lemma (line 120) | def find_lemma(self, verb):
method find_lexeme (line 125) | def find_lexeme(self, verb):
function attributive (line 138) | def attributive(adjective):
function predicative (line 144) | def predicative(adjective):
FILE: pattern/vector/__init__.py
function shi (line 94) | def shi(i, base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs...
function shuffled (line 106) | def shuffled(iterable, **kwargs):
function chunk (line 113) | def chunk(iterable, n):
function mix (line 127) | def mix(iterables=[], n=10):
function bin (line 138) | def bin(iterable, key=lambda x: x, value=lambda x: x):
function pimap (line 151) | def pimap(iterable, function, *args, **kwargs):
class ReadOnlyError (line 165) | class ReadOnlyError(Exception):
class readonlyodict (line 169) | class readonlyodict(OrderedDict):
method __init__ (line 170) | def __init__(self, *args, **kwargs):
method fromkeys (line 176) | def fromkeys(cls, k, default=None):
method __setitem__ (line 179) | def __setitem__(self, *args, **kwargs):
method __delitem__ (line 184) | def __delitem__(self, *args, **kwargs):
method pop (line 189) | def pop(self, *args, **kwargs):
method popitem (line 194) | def popitem(self, *args, **kwargs):
method update (line 199) | def update(self, *args, **kwargs):
class readonlydict (line 208) | class readonlydict(dict):
method __init__ (line 209) | def __init__(self, *args, **kwargs):
method fromkeys (line 213) | def fromkeys(cls, k, default=None):
method copy (line 216) | def copy(self):
method __setitem__ (line 219) | def __setitem__(self, k, v):
method __delitem__ (line 222) | def __delitem__(self, k):
method pop (line 225) | def pop(self, k, default=None):
method popitem (line 228) | def popitem(self, kv):
method clear (line 231) | def clear(self):
method update (line 234) | def update(self, kv):
method setdefault (line 237) | def setdefault(self, k, default=None):
class readonlylist (line 245) | class readonlylist(list):
method __init__ (line 246) | def __init__(self, *args, **kwargs):
method __setitem__ (line 249) | def __setitem__(self, i, v):
method __delitem__ (line 252) | def __delitem__(self, i):
method append (line 255) | def append(self, v):
method extend (line 258) | def extend(self, v):
method insert (line 261) | def insert(self, i, v):
method remove (line 264) | def remove(self, v):
method pop (line 267) | def pop(self, i):
function words (line 299) | def words(string, filter=lambda w: w.strip("'").isalnum(), punctuation=P...
function stem (line 314) | def stem(word, stemmer=PORTER, **kwargs):
function count (line 348) | def count(words=[], top=None, threshold=0, stemmer=None, exclude=[], sto...
function character_ngrams (line 377) | def character_ngrams(string="", n=3, top=None, threshold=0, exclude=[], ...
function _uid (line 408) | def _uid():
class Document (line 421) | class Document(object):
method __init__ (line 435) | def __init__(self, string="", **kwargs):
method load (line 512) | def load(cls, path):
method save (line 545) | def save(self, path):
method _get_model (line 579) | def _get_model(self):
method _set_model (line 582) | def _set_model(self, model):
method id (line 591) | def id(self):
method name (line 595) | def name(self):
method type (line 599) | def type(self):
method label (line 603) | def label(self):
method language (line 607) | def language(self):
method description (line 611) | def description(self):
method terms (line 615) | def terms(self):
method words (line 619) | def words(self):
method features (line 623) | def features(self):
method count (line 627) | def count(self):
method wordcount (line 635) | def wordcount(self):
method __len__ (line 638) | def __len__(self):
method __iter__ (line 641) | def __iter__(self):
method __contains__ (line 644) | def __contains__(self, word):
method __getitem__ (line 647) | def __getitem__(self, word):
method get (line 650) | def get(self, word, default=None):
method term_frequency (line 653) | def term_frequency(self, word):
method term_frequency_inverse_document_frequency (line 662) | def term_frequency_inverse_document_frequency(self, word, weight=TFIDF):
method information_gain (line 677) | def information_gain(self, word):
method gain_ratio (line 686) | def gain_ratio(self, word):
method vector (line 696) | def vector(self):
method concepts (line 723) | def concepts(self):
method keywords (line 728) | def keywords(self, top=10, normalized=True):
method cosine_similarity (line 737) | def cosine_similarity(self, document):
method copy (line 749) | def copy(self):
method __eq__ (line 754) | def __eq__(self, document):
method __ne__ (line 757) | def __ne__(self, document):
method __repr__ (line 760) | def __repr__(self):
class Vector (line 784) | class Vector(readonlydict):
method __init__ (line 788) | def __init__(self, *args, **kwargs):
method fromkeys (line 817) | def fromkeys(cls, k, default=None, **kwargs):
method features (line 821) | def features(self):
method l2_norm (line 825) | def l2_norm(self):
method copy (line 836) | def copy(self):
method __call__ (line 839) | def __call__(self, vector={}):
function features (line 861) | def features(vectors=[]):
function sparse (line 869) | def sparse(v):
function relative (line 878) | def relative(v):
function l2_norm (line 890) | def l2_norm(v):
function cosine_similarity (line 900) | def cosine_similarity(v1, v2):
function tf_idf (line 910) | def tf_idf(vectors=[], base=2.71828): # Euler's number
function distance (line 931) | def distance(v1, v2, method=COSINE):
function entropy (line 953) | def entropy(p=[], base=None):
class Model (line 990) | class Model(object):
method __init__ (line 992) | def __init__(self, documents=[], weight=TFIDF):
method documents (line 1017) | def documents(self):
method terms (line 1023) | def terms(self):
method classes (line 1029) | def classes(self):
method classifier (line 1035) | def classifier(self):
method distribution (line 1039) | def distribution(self):
method _get_lsa (line 1045) | def _get_lsa(self):
method _set_lsa (line 1048) | def _set_lsa(self, v=None):
method _get_weight (line 1054) | def _get_weight(self):
method _set_weight (line 1057) | def _set_weight(self, w):
method load (line 1064) | def load(cls, path):
method save (line 1078) | def save(self, path, update=False, final=False):
method export (line 1104) | def export(self, path, format=ORANGE, **kwargs):
method _update (line 1137) | def _update(self):
method __len__ (line 1153) | def __len__(self):
method __iter__ (line 1156) | def __iter__(self):
method __getitem__ (line 1159) | def __getitem__(self, i):
method __delitem__ (line 1162) | def __delitem__(self, i):
method clear (line 1168) | def clear(self):
method append (line 1172) | def append(self, document):
method extend (line 1186) | def extend(self, documents):
method remove (line 1200) | def remove(self, document):
method document (line 1205) | def document(self, name):
method keywords (line 1213) | def keywords(self, top=10, normalized=True):
method document_frequency (line 1223) | def document_frequency(self, word):
method inverse_document_frequency (line 1245) | def inverse_document_frequency(self, word, base=2.71828):
method inverted_index (line 1262) | def inverted_index(self):
method vector (line 1278) | def vector(self):
method vectors (line 1295) | def vectors(self):
method density (line 1301) | def density(self):
method frequent_concept_sets (line 1310) | def frequent_concept_sets(self, threshold=0.5):
method cosine_similarity (line 1318) | def cosine_similarity(self, document1, document2):
method nearest_neighbors (line 1349) | def nearest_neighbors(self, document, top=10):
method vector_space_search (line 1362) | def vector_space_search(self, words=[], **kwargs):
method distance (line 1380) | def distance(self, document1, document2, *args, **kwargs):
method cluster (line 1387) | def cluster(self, method=KMEANS, **kwargs):
method latent_semantic_analysis (line 1423) | def latent_semantic_analysis(self, dimensions=NORM):
method resample (line 1436) | def resample(self, n=MINORITY):
method condensed_nearest_neighbor (line 1491) | def condensed_nearest_neighbor(self, k=1, distance=COSINE):
method posterior_probability (line 1514) | def posterior_probability(self, word, type):
method chi_squared (line 1540) | def chi_squared(self, word):
method information_gain (line 1568) | def information_gain(self, word):
method gain_ratio (line 1634) | def gain_ratio(self, word):
method feature_selection (line 1643) | def feature_selection(self, top=100, method=CHISQUARED, threshold=0.0,...
method filter (line 1669) | def filter(self, features=[], documents=[]):
method train (line 1684) | def train(self, *args, **kwargs):
method predict (line 1699) | def predict(self, *args, **kwargs):
class Apriori (line 1713) | class Apriori(object):
method __init__ (line 1715) | def __init__(self):
method C1 (line 1719) | def C1(self, sets):
method Ck (line 1724) | def Ck(self, sets):
method Lk (line 1734) | def Lk(self, sets, candidates, support=0.0):
method __call__ (line 1745) | def __call__(self, sets=[], support=0.5):
class LSA (line 1774) | class LSA(object):
method __init__ (line 1776) | def __init__(self, model, k=NORM):
method terms (line 1832) | def terms(self):
method concepts (line 1840) | def concepts(self):
method vectors (line 1847) | def vectors(self):
method vector (line 1856) | def vector(self, id):
method __getitem__ (line 1861) | def __getitem__(self, id):
method __contains__ (line 1864) | def __contains__(self, id):
method __iter__ (line 1867) | def __iter__(self):
method __len__ (line 1870) | def __len__(self):
method transform (line 1873) | def transform(self, document):
function mean (line 1915) | def mean(iterable, length=None):
function centroid (line 1925) | def centroid(vectors=[], features=[]):
class DistanceMap (line 1947) | class DistanceMap(object):
method __init__ (line 1949) | def __init__(self, method=COSINE):
method __call__ (line 1955) | def __call__(self, v1, v2):
method distance (line 1958) | def distance(self, v1, v2):
function cluster (line 1973) | def cluster(method=KMEANS, vectors=[], **kwargs):
function k_means (line 1988) | def k_means(vectors, k=None, iterations=10, distance=COSINE, seed=RANDOM...
function kmpp (line 2043) | def kmpp(vectors, k, distance=COSINE):
class Cluster (line 2092) | class Cluster(list):
method __init__ (line 2094) | def __init__(self, *args, **kwargs):
method depth (line 2101) | def depth(self):
method flatten (line 2107) | def flatten(self, depth=1000):
method traverse (line 2119) | def traverse(self, visit=lambda cluster: None):
method __repr__ (line 2127) | def __repr__(self):
function sequence (line 2131) | def sequence(i=0, f=lambda i: i + 1):
function hierarchical (line 2144) | def hierarchical(vectors, k=1, iterations=1000, distance=COSINE, **kwargs):
class Classifier (line 2202) | class Classifier(object):
method __init__ (line 2204) | def __init__(self, train=[], baseline=MAJORITY, **kwargs):
method features (line 2224) | def features(self):
method classes (line 2230) | def classes(self):
method binary (line 2238) | def binary(self):
method distribution (line 2244) | def distribution(self):
method majority (line 2250) | def majority(self):
method minority (line 2257) | def minority(self):
method baseline (line 2264) | def baseline(self):
method weighted_random_baseline (line 2273) | def weighted_random_baseline(self):
method skewness (line 2283) | def skewness(self):
method train (line 2294) | def train(self, document, type=None):
method classify (line 2303) | def classify(self, document, discrete=True):
method _vector (line 2312) | def _vector(self, document, type=None, **kwargs):
method k_fold_cross_validation (line 2333) | def k_fold_cross_validation(cls, corpus=[], k=10, **kwargs):
method test (line 2340) | def test(cls, corpus=[], d=0.65, folds=1, **kwargs):
method _test (line 2351) | def _test(self, documents=[], target=None, **kwargs):
method auc (line 2362) | def auc(self, documents=[], k=10):
method confusion_matrix (line 2369) | def confusion_matrix(self, documents=[]):
method save (line 2376) | def save(self, path, final=False):
method load (line 2387) | def load(cls, path):
method _on_load (line 2397) | def _on_load(self, path):
method finalize (line 2400) | def finalize(self):
class Probabilities (line 2410) | class Probabilities(defaultdict):
method __init__ (line 2412) | def __init__(self, classifier, *args, **kwargs):
method max (line 2418) | def max(self):
class ConfusionMatrix (line 2436) | class ConfusionMatrix(defaultdict):
method __init__ (line 2438) | def __init__(self, classify=lambda document: True, documents=[]):
method split (line 2446) | def split(self):
method __call__ (line 2451) | def __call__(self, target):
method test (line 2470) | def test(self, target=None):
method auc (line 2489) | def auc(self, k=10):
method table (line 2503) | def table(self, padding=1):
method __repr__ (line 2519) | def __repr__(self):
function K_fold_cross_validation (line 2523) | def K_fold_cross_validation(Classifier, documents=[], folds=10, **kwargs):
function folds (line 2561) | def folds(documents=[], K=10, **kwargs):
function gridsearch (line 2584) | def gridsearch(Classifier, documents=[], folds=10, **kwargs):
function feature_selection (line 2613) | def feature_selection(documents=[], top=None, method=CHISQUARED, thresho...
class NB (line 2638) | class NB(Classifier):
method __init__ (line 2640) | def __init__(self, train=[], baseline=MAJORITY, method=MULTINOMIAL, al...
method method (line 2654) | def method(self):
method features (line 2658) | def features(self):
method train (line 2661) | def train(self, document, type=None):
method classify (line 2679) | def classify(self, document, discrete=True):
class KNN (line 2727) | class KNN(Classifier):
method __init__ (line 2729) | def __init__(self, train=[], baseline=MAJORITY, k=10, distance=COSINE,...
method train (line 2738) | def train(self, document, type=None):
method classify (line 2745) | def classify(self, document, discrete=True):
class IGTreeNode (line 2794) | class IGTreeNode(list):
method __init__ (line 2796) | def __init__(self, feature=None, value=None, type=None):
method children (line 2802) | def children(self):
method leaf (line 2806) | def leaf(self):
class IGTree (line 2810) | class IGTree(Classifier):
method __init__ (line 2812) | def __init__(self, train=[], baseline=MAJORITY, method=GAINRATIO, **kw...
method method (line 2822) | def method(self):
method _tree (line 2825) | def _tree(self, vectors=[], features=[]):
method _search (line 2872) | def _search(self, node, vector):
method train (line 2887) | def train(self, document, type=None):
method _train (line 2890) | def _train(self):
method classify (line 2904) | def classify(self, document, discrete=True):
method finalize (line 2915) | def finalize(self):
function softmax (line 3008) | def softmax(p):
class SLP (line 3025) | class SLP(Classifier):
method __init__ (line 3027) | def __init__(self, train=[], baseline=MAJORITY, iterations=1, **kwargs):
method iterations (line 3042) | def iterations(self):
method features (line 3046) | def features(self):
method train (line 3049) | def train(self, document, type=None):
method classify (line 3074) | def classify(self, document, discrete=True):
method finalize (line 3110) | def finalize(self):
function matrix (line 3146) | def matrix(m, n, a=0.0, b=0.0):
function sigmoid (line 3155) | def sigmoid(x):
function sigmoid_derivative (line 3162) | def sigmoid_derivative(y):
class BPNN (line 3169) | class BPNN(Classifier):
method __init__ (line 3171) | def __init__(self, train=[], baseline=MAJORITY, layers=2, iterations=1...
method layers (line 3187) | def layers(self):
method iterations (line 3191) | def iterations(self):
method rate (line 3195) | def rate(self):
method momentum (line 3199) | def momentum(self):
method _weight_initialization (line 3204) | def _weight_initialization(self, i=1, o=1, hidden=1, method=RANDOM, a=...
method _propagate_forward (line 3219) | def _propagate_forward(self, input=[]):
method _propagate_backward (line 3235) | def _propagate_backward(self, output=[], rate=0.5, momentum=0.1):
method _train (line 3268) | def _train(self, data=[], iterations=1000, rate=0.5, momentum=0.1):
method _classify (line 3291) | def _classify(self, input):
method train (line 3294) | def train(self, document, type=None):
method classify (line 3302) | def classify(self, document, discrete=True):
method finalize (line 3326) | def finalize(self):
class SVM (line 3381) | class SVM(Classifier):
method __init__ (line 3383) | def __init__(self, *args, **kwargs):
method extension (line 3450) | def extension(self):
method _extension (line 3461) | def _extension(self):
method type (line 3470) | def type(self):
method kernel (line 3474) | def kernel(self):
method solver (line 3478) | def solver(self):
method degree (line 3482) | def degree(self):
method gamma (line 3486) | def gamma(self):
method coeff0 (line 3490) | def coeff0(self):
method cost (line 3494) | def cost(self):
method epsilon (line 3498) | def epsilon(self):
method nu (line 3502) | def nu(self):
method cache (line 3506) | def cache(self):
method shrinking (line 3510) | def shrinking(self):
method support_vectors (line 3518) | def support_vectors(self):
method _train (line 3529) | def _train(self):
method _classify (line 3568) | def _classify(self, document, probability=False):
method train (line 3608) | def train(self, document, type=None):
method classify (line 3616) | def classify(self, document, discrete=True):
method save (line 3625) | def save(self, path, final=False):
method load (line 3642) | def load(cls, path):
method _on_load (line 3645) | def _on_load(self, path):
method finalize (line 3667) | def finalize(self):
class LR (line 3722) | class LR(Classifier):
method __init__ (line 3724) | def __init__(self, train=[], baseline=MAJORITY, iterations=100, **kwar...
method iterations (line 3739) | def iterations(self):
method _train (line 3742) | def _train(self):
method _classify (line 3764) | def _classify(self, document):
method _gradient_descent (line 3777) | def _gradient_descent(self, x, y, l=0.1, iterations=100):
method train (line 3820) | def train(self, document, type=None):
method classify (line 3828) | def classify(self, document, discrete=True):
method save (line 3848) | def save(self, path, final=False):
method load (line 3859) | def load(cls, path):
method _on_load (line 3862) | def _on_load(self, path):
method finalize (line 3874) | def finalize(self):
class GeneticAlgorithm (line 3887) | class GeneticAlgorithm(object):
method __init__ (line 3889) | def __init__(self, candidates=[], **kwargs):
method fitness (line 3901) | def fitness(self, candidate):
method combine (line 3906) | def combine(self, candidate1, candidate2):
method mutate (line 3911) | def mutate(self, candidate):
method update (line 3916) | def update(self, top=0.5, mutation=0.5):
method avg (line 3940) | def avg(self):
FILE: pattern/vector/stemmer.py
function is_vowel (line 40) | def is_vowel(s):
function is_consonant (line 44) | def is_consonant(s):
function is_double_consonant (line 48) | def is_double_consonant(s):
function is_short_syllable (line 52) | def is_short_syllable(w, before=None):
function is_short (line 68) | def is_short(w):
function R1 (line 83) | def R1(w):
function R2 (line 93) | def R2(w):
function find_vowel (line 102) | def find_vowel(w):
function has_vowel (line 112) | def has_vowel(w):
function vowel_consonant_pairs (line 121) | def vowel_consonant_pairs(w, max=None):
function step_1a (line 136) | def step_1a(w):
function step_1b (line 155) | def step_1b(w):
function step_1c (line 184) | def step_1c(w):
function step_2 (line 206) | def step_2(w):
function step_3 (line 228) | def step_3(w):
function step_4 (line 251) | def step_4(w):
function step_5a (line 266) | def step_5a(w):
function step_5b (line 276) | def step_5b(w):
function case_sensitive (line 319) | def case_sensitive(stem, word):
function upper_consonant_y (line 332) | def upper_consonant_y(w):
function stem (line 351) | def stem(word, cached=True, history=10000, **kwargs):
FILE: pattern/vector/svm/liblinear.py
function print_null (line 59) | def print_null(s):
function genFields (line 63) | def genFields(names, types):
function fillprototype (line 67) | def fillprototype(f, restype, argtypes):
class feature_node (line 72) | class feature_node(Structure):
method __str__ (line 77) | def __str__(self):
function gen_feature_nodearray (line 81) | def gen_feature_nodearray(xi, feature_max=None):
function csr_to_problem_jit (line 138) | def csr_to_problem_jit(l, x_val, x_ind, x_rowptr, prob_val, prob_ind, pr...
function csr_to_problem_nojit (line 147) | def csr_to_problem_nojit(l, x_val, x_ind, x_rowptr, prob_val, prob_ind, ...
function csr_to_problem (line 155) | def csr_to_problem(x, prob):
class problem (line 169) | class problem(Structure):
method __init__ (line 174) | def __init__(self, y, x, bias = -1):
method set_bias (line 225) | def set_bias(self, bias):
class parameter (line 245) | class parameter(Structure):
method __init__ (line 250) | def __init__(self, options = None):
method __str__ (line 255) | def __str__(self):
method set_to_default_values (line 265) | def set_to_default_values(self):
method parse_options (line 282) | def parse_options(self, options):
class model (line 363) | class model(Structure):
method __init__ (line 368) | def __init__(self):
method __del__ (line 371) | def __del__(self):
method get_nr_feature (line 376) | def get_nr_feature(self):
method get_nr_class (line 379) | def get_nr_class(self):
method get_labels (line 382) | def get_labels(self):
method get_decfun_coef (line 388) | def get_decfun_coef(self, feat_idx, label_idx=0):
method get_decfun_bias (line 391) | def get_decfun_bias(self, label_idx=0):
method get_decfun (line 394) | def get_decfun(self, label_idx=0):
method is_probability_model (line 399) | def is_probability_model(self):
method is_regression_model (line 402) | def is_regression_model(self):
function toPyModel (line 406) | def toPyModel(model_ptr):
FILE: pattern/vector/svm/liblinearutil.py
function svm_read_problem (line 24) | def svm_read_problem(data_file_name, return_scipy=False):
function load_model (line 69) | def load_model(model_file_name):
function save_model (line 83) | def save_model(model_file_name, model):
function evaluations_scipy (line 92) | def evaluations_scipy(ty, pv):
function evaluations (line 120) | def evaluations(ty, pv, useScipy = True):
function train (line 154) | def train(arg1, arg2=None, arg3=None):
function predict (line 263) | def predict(y, x, m, options=""):
FILE: pattern/vector/svm/libsvm.py
function print_null (line 54) | def print_null(s):
function genFields (line 58) | def genFields(names, types):
function fillprototype (line 62) | def fillprototype(f, restype, argtypes):
class svm_node (line 67) | class svm_node(Structure):
method __str__ (line 72) | def __str__(self):
function gen_svm_nodearray (line 76) | def gen_svm_nodearray(xi, feature_max=None, isKernel=None):
class svm_problem (line 104) | class svm_problem(Structure):
method __init__ (line 109) | def __init__(self, y, x, isKernel=None):
class svm_parameter (line 131) | class svm_parameter(Structure):
method __init__ (line 140) | def __init__(self, options = None):
method __str__ (line 145) | def __str__(self):
method set_to_default_values (line 155) | def set_to_default_values(self):
method parse_options (line 175) | def parse_options(self, options):
class svm_model (line 250) | class svm_model(Structure):
method __init__ (line 259) | def __init__(self):
method __del__ (line 262) | def __del__(self):
method get_svm_type (line 267) | def get_svm_type(self):
method get_nr_class (line 270) | def get_nr_class(self):
method get_svr_probability (line 273) | def get_svr_probability(self):
method get_labels (line 276) | def get_labels(self):
method get_sv_indices (line 282) | def get_sv_indices(self):
method get_nr_sv (line 288) | def get_nr_sv(self):
method is_probability_model (line 291) | def is_probability_model(self):
method get_sv_coef (line 294) | def get_sv_coef(self):
method get_SV (line 298) | def get_SV(self):
function toPyModel (line 314) | def toPyModel(model_ptr):
FILE: pattern/vector/svm/libsvmutil.py
function svm_read_problem (line 23) | def svm_read_problem(data_file_name):
function svm_load_model (line 47) | def svm_load_model(model_file_name):
function svm_save_model (line 61) | def svm_save_model(model_file_name, model):
function evaluations (line 70) | def evaluations(ty, pv):
function svm_train (line 100) | def svm_train(arg1, arg2=None, arg3=None):
function svm_predict (line 188) | def svm_predict(y, x, m, options=""):
FILE: pattern/web/__init__.py
function fix (line 130) | def fix(s, ignore=""):
function latin (line 172) | def latin(s):
class AsynchronousRequest (line 186) | class AsynchronousRequest(object):
method __init__ (line 188) | def __init__(self, function, *args, **kwargs):
method _fetch (line 204) | def _fetch(self, function, *args, **kwargs):
method now (line 212) | def now(self):
method elapsed (line 219) | def elapsed(self):
method done (line 223) | def done(self):
method value (line 227) | def value(self):
method error (line 231) | def error(self):
method __repr__ (line 234) | def __repr__(self):
function asynchronous (line 238) | def asynchronous(function, *args, **kwargs):
function extension (line 278) | def extension(filename):
function urldecode (line 284) | def urldecode(query):
function proxy (line 310) | def proxy(host, protocol="https"):
class Error (line 317) | class Error(Exception):
method __init__ (line 321) | def __init__(self, *args, **kwargs):
method headers (line 327) | def headers(self):
class URLError (line 331) | class URLError(Error):
class URLTimeout (line 335) | class URLTimeout(URLError):
class HTTPError (line 339) | class HTTPError(URLError):
class HTTP301Redirect (line 343) | class HTTP301Redirect(HTTPError):
class HTTP400BadRequest (line 351) | class HTTP400BadRequest(HTTPError):
class HTTP401Authentication (line 355) | class HTTP401Authentication(HTTPError):
class HTTP403Forbidden (line 359) | class HTTP403Forbidden(HTTPError):
class HTTP404NotFound (line 363) | class HTTP404NotFound(HTTPError):
class HTTP414RequestURITooLong (line 367) | class HTTP414RequestURITooLong(HTTPError):
class HTTP420Error (line 371) | class HTTP420Error(HTTPError):
class HTTP429TooMayRequests (line 375) | class HTTP429TooMayRequests(HTTPError):
class HTTP500InternalServerError (line 379) | class HTTP500InternalServerError(HTTPError):
class HTTP503ServiceUnavailable (line 383) | class HTTP503ServiceUnavailable(HTTPError):
class URL (line 387) | class URL(object):
method __init__ (line 389) | def __init__(self, string="", method=GET, query={}, **kwargs):
method _parse (line 418) | def _parse(self):
method _get_string (line 458) | def _get_string(self): return str(self)
method _set_string (line 460) | def _set_string(self, v):
method parts (line 467) | def parts(self):
method querystring (line 475) | def querystring(self):
method __getattr__ (line 489) | def __getattr__(self, k):
method __setattr__ (line 496) | def __setattr__(self, k, v):
method open (line 511) | def open(self, timeout=10, proxy=None, user_agent=USER_AGENT, referrer...
method download (line 580) | def download(self, timeout=10, cached=True, throttle=0, proxy=None, us...
method read (line 614) | def read(self, *args, **kwargs):
method exists (line 618) | def exists(self, timeout=10):
method mimetype (line 636) | def mimetype(self, timeout=10):
method headers (line 647) | def headers(self, timeout=10):
method redirect (line 664) | def redirect(self, timeout=10):
method __str__ (line 675) | def __str__(self):
method __repr__ (line 703) | def __repr__(self):
method copy (line 706) | def copy(self):
function download (line 710) | def download(url="", method=GET, query={}, timeout=10, cached=True, thro...
function bind (line 724) | def bind(object, method, function):
class Stream (line 735) | class Stream(list):
method __init__ (line 737) | def __init__(self, url, delimiter="\n", **kwargs):
method update (line 744) | def update(self, bytes=1024):
method parse (line 762) | def parse(self, data):
method clear (line 767) | def clear(self):
function stream (line 771) | def stream(url, delimiter="\n", parse=lambda data: data, **kwargs):
function find_urls (line 794) | def find_urls(string, unique=True):
function find_email (line 817) | def find_email(string, unique=True):
function find_between (line 829) | def find_between(a, b, string):
class HTMLParser (line 861) | class HTMLParser(_HTMLParser):
method clean (line 863) | def clean(self, html):
class HTMLTagstripper (line 874) | class HTMLTagstripper(HTMLParser):
method __init__ (line 876) | def __init__(self):
method strip (line 879) | def strip(self, html, exclude=[], replace=blocks):
method handle_starttag (line 896) | def handle_starttag(self, tag, attributes):
method handle_endtag (line 912) | def handle_endtag(self, tag):
method handle_data (line 922) | def handle_data(self, data):
method handle_comment (line 925) | def handle_comment(self, comment):
function strip_element (line 934) | def strip_element(string, tag, attributes=""):
function strip_between (line 964) | def strip_between(a, b, string):
function strip_javascript (line 972) | def strip_javascript(html):
function strip_inline_css (line 976) | def strip_inline_css(html):
function strip_comments (line 980) | def strip_comments(html):
function strip_forms (line 984) | def strip_forms(html):
function encode_entities (line 991) | def encode_entities(string):
function decode_entities (line 1005) | def decode_entities(string):
function encode_url (line 1024) | def encode_url(string):
function decode_url (line 1028) | def decode_url(string):
function collapse_spaces (line 1035) | def collapse_spaces(string, indentation=False, replace=" "):
function collapse_tabs (line 1047) | def collapse_tabs(string, indentation=False, replace=" "):
function collapse_linebreaks (line 1059) | def collapse_linebreaks(string, threshold=1):
function plaintext (line 1070) | def plaintext(html, keep=[], replace=blocks, linebreaks=2, indentation=F...
class Result (line 1115) | class Result(dict):
method __init__ (line 1117) | def __init__(self, url, **kwargs):
method txt (line 1143) | def txt(self):
method description (line 1147) | def description(self):
method likes (line 1151) | def likes(self):
method retweets (line 1155) | def retweets(self):
method download (line 1158) | def download(self, *args, **kwargs):
method _format (line 1164) | def _format(self, v):
method __getattr__ (line 1171) | def __getattr__(self, k):
method __getitem__ (line 1174) | def __getitem__(self, k):
method __setattr__ (line 1177) | def __setattr__(self, k, v):
method __setitem__ (line 1180) | def __setitem__(self, k, v):
method setdefault (line 1183) | def setdefault(self, k, v=None):
method update (line 1186) | def update(self, *args, **kwargs):
method __repr__ (line 1189) | def __repr__(self):
class Results (line 1193) | class Results(list):
method __init__ (line 1195) | def __init__(self, source=None, query=None, type=SEARCH, total=0):
class SearchEngine (line 1209) | class SearchEngine(object):
method __init__ (line 1211) | def __init__(self, license=None, throttle=1.0, language=None):
method search (line 1222) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
class SearchEngineError (line 1226) | class SearchEngineError(HTTPError):
class SearchEngineTypeError (line 1230) | class SearchEngineTypeError(SearchEngineError):
class SearchEngineLimitError (line 1234) | class SearchEngineLimitError(SearchEngineError):
class Google (line 1252) | class Google(SearchEngine):
method __init__ (line 1254) | def __init__(self, license=None, throttle=0.5, language=None):
method search (line 1257) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
method translate (line 1305) | def translate(self, string, input="en", output="fr", **kwargs):
method identify (line 1329) | def identify(self, string, **kwargs):
class Yahoo (line 1358) | class Yahoo(SearchEngine):
method __init__ (line 1360) | def __init__(self, license=None, throttle=0.5, language=None):
method _authenticate (line 1363) | def _authenticate(self, url):
method search (line 1377) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
class Bing (line 1444) | class Bing(SearchEngine):
method __init__ (line 1446) | def __init__(self, license=None, throttle=0.5, language=None):
method search (line 1449) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
class DuckDuckGo (line 1530) | class DuckDuckGo(SearchEngine):
method __init__ (line 1532) | def __init__(self, license=None, throttle=0.5, language=None):
method search (line 1535) | def search(self, query, type=SEARCH, start=None, count=None, sort=RELE...
method answer (line 1596) | def answer(self, string, **kwargs):
method spelling (line 1611) | def spelling(self, string):
method definition (line 1618) | def definition(self, string):
class Faroo (line 1648) | class Faroo(SearchEngine):
method __init__ (line 1650) | def __init__(self, license = None, throttle = 0.5, language = None):
method search (line 1653) | def search(self, query, type = SEARCH, start = 1, count = 10, sort = R...
class VKAPI (line 1716) | class VKAPI(object):
method __init__ (line 1717) | def __init__(self, *args, **kwargs):
method __getattr__ (line 1721) | def __getattr__(self, method_name):
method __call__ (line 1724) | def __call__(self, method_name, **method_kwargs):
class VKRequest (line 1728) | class VKRequest(object):
method __init__ (line 1731) | def __init__(self, api, method_name):
method __getattr__ (line 1736) | def __getattr__(self, method_name):
method __call__ (line 1739) | def __call__(self, **method_args):
class VK (line 1744) | class VK(SearchEngine):
method __init__ (line 1790) | def __init__(self, lisense, throttle=1.0, language=None):
method _get_city_name_by_id (line 1797) | def _get_city_name_by_id(self, city_id):
method _get_country_name_by_id (line 1801) | def _get_country_name_by_id(self, country_id):
method _get_sex_by_id (line 1805) | def _get_sex_by_id(self, sex_id):
method get_users_info (line 1808) | def get_users_info(self, user_ids):
method get_user_posts (line 1855) | def get_user_posts(self, user_id, count=100, posts_type="all"):
method get_newsfeed_posts (line 1899) | def get_newsfeed_posts(self, query, count=100, end_time=None):
class VkException (line 1943) | class VkException(Exception):
class VkAuthError (line 1947) | class VkAuthError(VkException):
class VkAPIError (line 1951) | class VkAPIError(VkException):
method __init__ (line 1957) | def __init__(self, error_data):
method get_pretty_request_params (line 1966) | def get_pretty_request_params(error_data):
method __str__ (line 1971) | def __str__(self):
class Session (line 1978) | class Session(object):
method __init__ (line 1980) | def __init__(self, scope='offline', access_token='', timeout=10, **met...
method make_request (line 1992) | def make_request(self, request):
method send_api_request (line 2006) | def send_api_request(self, request):
class Twitter (line 2033) | class Twitter(SearchEngine):
method __init__ (line 2035) | def __init__(self, license=None, throttle=0.5, language=None):
method _authenticate (line 2039) | def _authenticate(self, url):
method search (line 2055) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
method profile (line 2150) | def profile(self, query, start=1, count=10, **kwargs):
method trends (line 2184) | def trends(self, **kwargs):
method stream (line 2201) | def stream(self, query, **kwargs):
class TwitterStream (line 2210) | class TwitterStream(Stream):
method __init__ (line 2212) | def __init__(self, socket, delimiter="\n", format=lambda s: s, **kwargs):
method parse (line 2217) | def parse(self, data):
function author (line 2246) | def author(name):
function hashtags (line 2253) | def hashtags(string):
function mentions (line 2259) | def mentions(string):
function retweets (line 2265) | def retweets(string):
class MediaWiki (line 2325) | class MediaWiki(SearchEngine):
method __init__ (line 2327) | def __init__(self, license=None, throttle=5.0, language="en"):
method _url (line 2331) | def _url(self):
method MediaWikiArticle (line 2336) | def MediaWikiArticle(self):
method MediaWikiSection (line 2340) | def MediaWikiSection(self):
method MediaWikiTable (line 2344) | def MediaWikiTable(self):
method __iter__ (line 2347) | def __iter__(self):
method articles (line 2350) | def articles(self, **kwargs):
method index (line 2361) | def index(self, namespace=0, start=None, count=100, cached=True, **kwa...
method search (line 2392) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
method article (line 2430) | def article(self, query, cached=True, **kwargs):
method _parse_article (line 2455) | def _parse_article(self, data, **kwargs):
method _parse_article_sections (line 2469) | def _parse_article_sections(self, article, data):
method _parse_article_section_structure (line 2495) | def _parse_article_section_structure(self, article):
class MediaWikiArticle (line 2506) | class MediaWikiArticle(object):
method __init__ (line 2508) | def __init__(self, title="", source="", links=[], categories=[], langu...
method _plaintext (line 2527) | def _plaintext(self, string, **kwargs):
method plaintext (line 2577) | def plaintext(self, **kwargs):
method html (line 2581) | def html(self):
method src (line 2585) | def src(self):
method string (line 2589) | def string(self):
method __repr__ (line 2592) | def __repr__(self):
class MediaWikiSection (line 2596) | class MediaWikiSection(object):
method __init__ (line 2598) | def __init__(self, article, title="", start=0, stop=0, level=1):
method plaintext (line 2611) | def plaintext(self, **kwargs):
method source (line 2615) | def source(self):
method html (line 2619) | def html(self):
method src (line 2623) | def src(self):
method string (line 2627) | def string(self):
method content (line 2631) | def content(self):
method links (line 2640) | def links(self, path="/wiki/"):
method tables (line 2653) | def tables(self):
method level (line 2683) | def level(self):
method __repr__ (line 2688) | def __repr__(self):
class MediaWikiTable (line 2692) | class MediaWikiTable(object):
method __init__ (line 2694) | def __init__(self, section, title="", headers=[], rows=[], source=""):
method plaintext (line 2703) | def plaintext(self, **kwargs):
method html (line 2707) | def html(self):
method src (line 2711) | def src(self):
method string (line 2715) | def string(self):
method __repr__ (line 2718) | def __repr__(self):
class Wikipedia (line 2726) | class Wikipedia(MediaWiki):
method __init__ (line 2728) | def __init__(self, license=None, throttle=5.0, language="en"):
method _url (line 2735) | def _url(self):
method MediaWikiArticle (line 2743) | def MediaWikiArticle(self):
method MediaWikiSection (line 2747) | def MediaWikiSection(self):
method MediaWikiTable (line 2751) | def MediaWikiTable(self):
class WikipediaArticle (line 2755) | class WikipediaArticle(MediaWikiArticle):
method download (line 2757) | def download(self, media, **kwargs):
method __repr__ (line 2773) | def __repr__(self):
class WikipediaSection (line 2777) | class WikipediaSection(MediaWikiSection):
method __repr__ (line 2778) | def __repr__(self):
class WikipediaTable (line 2782) | class WikipediaTable(MediaWikiTable):
method __repr__ (line 2783) | def __repr__(self):
class Wiktionary (line 2807) | class Wiktionary(MediaWiki):
method __init__ (line 2809) | def __init__(self, license=None, throttle=5.0, language="en"):
method _url (line 2816) | def _url(self):
method MediaWikiArticle (line 2824) | def MediaWikiArticle(self):
method MediaWikiSection (line 2828) | def MediaWikiSection(self):
method MediaWikiTable (line 2832) | def MediaWikiTable(self):
class WiktionaryArticle (line 2836) | class WiktionaryArticle(MediaWikiArticle):
method __repr__ (line 2837) | def __repr__(self):
class WiktionarySection (line 2841) | class WiktionarySection(MediaWikiSection):
method __repr__ (line 2842) | def __repr__(self):
class WiktionaryTable (line 2846) | class WiktionaryTable(MediaWikiTable):
method __repr__ (line 2847) | def __repr__(self):
class Wikia (line 2857) | class Wikia(MediaWiki):
method __init__ (line 2859) | def __init__(self, domain="www", license=None, throttle=5.0, language=...
method _url (line 2866) | def _url(self):
method MediaWikiArticle (line 2874) | def MediaWikiArticle(self):
method MediaWikiSection (line 2878) | def MediaWikiSection(self):
method MediaWikiTable (line 2882) | def MediaWikiTable(self):
method articles (line 2885) | def articles(self, **kwargs):
class WikiaArticle (line 2917) | class WikiaArticle(MediaWikiArticle):
method __repr__ (line 2918) | def __repr__(self):
class WikiaSection (line 2922) | class WikiaSection(MediaWikiSection):
method __repr__ (line 2923) | def __repr__(self):
class WikiaTable (line 2927) | class WikiaTable(MediaWikiTable):
method __repr__ (line 2928) | def __repr__(self):
class DBPediaQueryError (line 2964) | class DBPediaQueryError(HTTP400BadRequest):
class DBPediaResource (line 2968) | class DBPediaResource(str):
method name (line 2970) | def name(self):
class DBPedia (line 2981) | class DBPedia(SearchEngine):
method __init__ (line 2983) | def __init__(self, license=None, throttle=1.0, language=None):
method search (line 2986) | def search(self, query, type=SPARQL, start=1, count=10, sort=RELEVANCY...
class Flickr (line 3044) | class Flickr(SearchEngine):
method __init__ (line 3046) | def __init__(self, license=None, throttle=5.0, language=None):
method search (line 3049) | def search(self, query, type=IMAGE, start=1, count=10, sort=RELEVANCY,...
class FlickrResult (line 3099) | class FlickrResult(Result):
method url (line 3102) | def url(self):
class FacebookResult (line 3144) | class FacebookResult(Result):
method __repr__ (line 3145) | def __repr__(self):
class Facebook (line 3149) | class Facebook(SearchEngine):
method __init__ (line 3151) | def __init__(self, license=None, throttle=1.0, language=None):
method _token (line 3155) | def _token(self):
method search (line 3173) | def search(self, query, type=SEARCH, start=1, count=10, cached=False, ...
method profile (line 3259) | def profile(self, id=None, **kwargs):
class ProductWiki (line 3297) | class ProductWiki(SearchEngine):
method __init__ (line 3299) | def __init__(self, license=None, throttle=5.0, language=None):
method search (line 3302) | def search(self, query, type=SEARCH, start=1, count=10, sort=RELEVANCY...
class Newsfeed (line 3362) | class Newsfeed(SearchEngine):
method __init__ (line 3364) | def __init__(self, license=None, throttle=1.0, language=None):
method search (line 3367) | def search(self, query, type=NEWS, start=1, count=10, sort=LATEST, siz...
function query (line 3421) | def query(string, service=GOOGLE, **kwargs):
function sort (line 3470) | def sort(terms=[], context="", service=GOOGLE, license=None, strict=True...
class Node (line 3521) | class Node(object):
method __init__ (line 3523) | def __init__(self, html, type=NODE, **kwargs):
method _beautifulSoup (line 3531) | def _beautifulSoup(self):
method __eq__ (line 3535) | def __eq__(self, other):
method _wrap (line 3539) | def _wrap(self, x):
method parent (line 3551) | def parent(self):
method children (line 3555) | def children(self):
method html (line 3559) | def html(self):
method source (line 3563) | def source(self):
method next_sibling (line 3567) | def next_sibling(self):
method previous_sibling (line 3571) | def previous_sibling(self):
method traverse (line 3577) | def traverse(self, visit=lambda node: None):
method remove (line 3583) | def remove(self, child):
method __bool__ (line 3588) | def __bool__(self):
method __len__ (line 3591) | def __len__(self):
method __iter__ (line 3594) | def __iter__(self):
method __getitem__ (line 3597) | def __getitem__(self, index):
method __repr__ (line 3600) | def __repr__(self):
method __str__ (line 3603) | def __str__(self):
method __call__ (line 3606) | def __call__(self, *args, **kwargs):
class Text (line 3612) | class Text(Node):
method __init__ (line 3617) | def __init__(self, string):
method __repr__ (line 3620) | def __repr__(self):
class Comment (line 3624) | class Comment(Text):
method __init__ (line 3629) | def __init__(self, string):
method __repr__ (line 3632) | def __repr__(self):
class Element (line 3638) | class Element(Node):
method __init__ (line 3640) | def __init__(self, html):
method tagname (line 3647) | def tagname(self):
method attributes (line 3653) | def attributes(self):
method id (line 3659) | def id(self):
method content (line 3663) | def content(self):
method source (line 3671) | def source(self):
method get_elements_by_tagname (line 3678) | def get_elements_by_tagname(self, v):
method get_element_by_id (line 3694) | def get_element_by_id(self, v):
method get_elements_by_classname (line 3701) | def get_elements_by_classname(self, v):
method get_elements_by_attribute (line 3708) | def get_elements_by_attribute(self, **kwargs):
method __call__ (line 3715) | def __call__(self, selector):
method __getattr__ (line 3721) | def __getattr__(self, k):
method __contains__ (line 3728) | def __contains__(self, v):
method __repr__ (line 3733) | def __repr__(self):
class Document (line 3739) | class Document(Element):
method __init__ (line 3741) | def __init__(self, html, **kwargs):
method declaration (line 3750) | def declaration(self):
method head (line 3758) | def head(self):
method body (line 3762) | def body(self):
method tagname (line 3766) | def tagname(self):
method __repr__ (line 3771) | def __repr__(self):
function _encode_space (line 3804) | def _encode_space(s):
function _decode_space (line 3808) | def _decode_space(s):
class Selector (line 3812) | class Selector(object):
method __init__ (line 3814) | def __init__(self, s):
method _parse_attribute (line 3841) | def _parse_attribute(self, s):
method _first_child (line 3868) | def _first_child(self, e):
method _next_sibling (line 3876) | def _next_sibling(self, e):
method _previous_sibling (line 3884) | def _previous_sibling(self, e):
method _contains (line 3892) | def _contains(self, e, s):
method match (line 3900) | def match(self, e):
method search (line 3920) | def search(self, e):
method __repr__ (line 3944) | def __repr__(self):
class SelectorChain (line 3948) | class SelectorChain(list):
method __init__ (line 3950) | def __init__(self, s):
method search (line 3977) | def search(self, e):
class Link (line 4025) | class Link(object):
method __init__ (line 4027) | def __init__(self, url, text="", relation="", referrer=""):
method description (line 4035) | def description(self):
method __repr__ (line 4038) | def __repr__(self):
method __eq__ (line 4042) | def __eq__(self, link):
method __ne__ (line 4045) | def __ne__(self, link):
method __lt__ (line 4048) | def __lt__(self, link):
method __gt__ (line 4051) | def __gt__(self, link):
class HTMLLinkParser (line 4055) | class HTMLLinkParser(HTMLParser):
method __init__ (line 4057) | def __init__(self):
method parse (line 4060) | def parse(self, html, url=""):
method handle_starttag (line 4072) | def handle_starttag(self, tag, attributes):
function base (line 4083) | def base(url):
function abs (line 4090) | def abs(url, base=None):
class Crawler (line 4107) | class Crawler(object):
method __init__ (line 4109) | def __init__(self, links=[], domains=[], delay=20.0, parse=HTMLLinkPar...
method done (line 4130) | def done(self):
method push (line 4135) | def push(self, link, priority=1.0, sort=FILO):
method pop (line 4149) | def pop(self, remove=True):
method next (line 4162) | def next(self):
method crawl (line 4167) | def crawl(self, method=DEPTH, **kwargs):
method normalize (line 4226) | def normalize(self, url):
method follow (line 4234) | def follow(self, link):
method priority (line 4240) | def priority(self, link, method=DEPTH):
method visit (line 4253) | def visit(self, link, source=None):
method fail (line 4260) | def fail(self, link):
function crawl (line 4282) | def crawl(links=[], domains=[], delay=20.0, parse=HTMLLinkParser().parse...
class DocumentParserError (line 4323) | class DocumentParserError(Exception):
class DocumentParser (line 4327) | class DocumentParser(object):
method __init__ (line 4329) | def __init__(self, path, *args, **kwargs):
method _open (line 4335) | def _open(self, path):
method _parse (line 4345) | def _parse(self, path, *args, **kwargs):
method string (line 4351) | def string(self):
method __str__ (line 4354) | def __str__(self):
class PDFError (line 4361) | class PDFError(DocumentParserError):
class PDF (line 4365) | class PDF(DocumentParser):
method __init__ (line 4367) | def __init__(self, path, output="txt"):
method _parse (line 4370) | def _parse(self, path, *args, **kwargs):
class DOCXError (line 4403) | class DOCXError(DocumentParserError):
class DOCX (line 4407) | class DOCX(DocumentParser):
method _parse (line 4409) | def _parse(self, path, *args, **kwargs):
function parsepdf (line 4424) | def parsepdf(path, *args, **kwargs):
function parsedocx (line 4430) | def parsedocx(path, *args, **kwargs):
function parsehtml (line 4436) | def parsehtml(path, *args, **kwargs):
function parsedoc (line 4442) | def parsedoc(path, format=None):
FILE: pattern/web/cache/__init__.py
function date_now (line 49) | def date_now():
function date_modified (line 53) | def date_modified(path):
class Cache (line 57) | class Cache(object):
method __init__ (line 59) | def __init__(self, path=os.path.join(MODULE, "tmp")):
method _get_path (line 67) | def _get_path(self):
method _set_path (line 70) | def _set_path(self, path):
method _hash (line 76) | def _hash(self, k):
method __len__ (line 80) | def __len__(self):
method __contains__ (line 83) | def __contains__(self, k):
method __getitem__ (line 86) | def __getitem__(self, k):
method __setitem__ (line 89) | def __setitem__(self, k, v):
method __delitem__ (line 96) | def __delitem__(self, k):
method get (line 102) | def get(self, k, unicode=True):
method age (line 116) | def age(self, k):
method clear (line 122) | def clear(self, age=None):
FILE: pattern/web/imap/__init__.py
class IMAP4 (line 49) | class IMAP4(imaplib.IMAP4):
class IMAP4_SSL (line 53) | class IMAP4_SSL(imaplib.IMAP4_SSL):
function _basename (line 64) | def _basename(folder):
class MailError (line 75) | class MailError(Exception):
class MailServiceError (line 79) | class MailServiceError(MailError):
class MailLoginError (line 83) | class MailLoginError(MailError):
class MailNotLoggedIn (line 87) | class MailNotLoggedIn(MailError):
class Mail (line 91) | class Mail(object):
method __init__ (line 93) | def __init__(self, username, password, service=GMAIL, port=993, secure...
method _id (line 108) | def _id(self):
method imap4 (line 112) | def imap4(self):
method login (line 117) | def login(self, username, password, **kwargs):
method logout (line 131) | def logout(self):
method __del__ (line 138) | def __del__(self):
method folders (line 145) | def folders(self):
method __getattr__ (line 157) | def __getattr__(self, k):
function _decode (line 169) | def _decode(s, message):
class MailFolder (line 192) | class MailFolder(object):
method __init__ (line 194) | def __init__(self, parent, name):
method parent (line 202) | def parent(self):
method name (line 206) | def name(self):
method count (line 210) | def count(self):
method search (line 213) | def search(self, q, field=FROM, cached=False):
method read (line 227) | def read(self, i, attachments=False, cached=True):
method __getitem__ (line 230) | def __getitem__(self, i, attachments=False, cached=True):
method __iter__ (line 271) | def __iter__(self):
method __len__ (line 277) | def __len__(self):
method __repr__ (line 281) | def __repr__(self):
class Message (line 287) | class Message(dict):
method author (line 290) | def author(self):
method date (line 294) | def date(self):
method subject (line 298) | def subject(self):
method body (line 302) | def body(self):
method attachments (line 306) | def attachments(self):
method email_address (line 310) | def email_address(self):
method __repr__ (line 314) | def __repr__(self):
FILE: pattern/web/locale/__init__.py
function encode_language (line 161) | def encode_language(name):
function decode_language (line 170) | def decode_language(code):
function encode_region (line 179) | def encode_region(name):
function decode_region (line 188) | def decode_region(code):
function languages (line 197) | def languages(region):
function regions (line 208) | def regions(language):
function regionalize (line 219) | def regionalize(language):
function market (line 234) | def market(language):
function geocode (line 399) | def geocode(location):
FILE: pattern/web/oauth/__init__.py
function HMAC_SHA1 (line 55) | def HMAC_SHA1(key, text):
function nonce (line 59) | def nonce():
function timestamp (line 63) | def timestamp():
function escape (line 67) | def escape(string):
function utf8 (line 71) | def utf8(string):
function normalize (line 75) | def normalize(string):
function base (line 85) | def base(url, data={}, method="GET"):
function sign (line 95) | def sign(url, data={}, method="GET", secret="", token="", hash=HMAC_SHA1):
FILE: pattern/web/utils.py
function json_iter_parse (line 26) | def json_iter_parse(response_text):
function stringify_values (line 34) | def stringify_values(dictionary):
function get_url_query (line 43) | def get_url_query(url):
function get_form_action (line 51) | def get_form_action(html):
function censor_access_token (line 57) | def censor_access_token(access_token):
FILE: test/test.js
function assert (line 1) | function assert(expression) {
function TestCase (line 7) | function TestCase() {
function run (line 23) | function run(tests) {
FILE: test/test_db.py
function create_db_mysql (line 30) | def create_db_mysql():
function create_db_sqlite (line 51) | def create_db_sqlite():
class TestUnicode (line 74) | class TestUnicode(unittest.TestCase):
method setUp (line 76) | def setUp(self):
method test_decode_utf8 (line 87) | def test_decode_utf8(self):
method test_encode_utf8 (line 93) | def test_encode_utf8(self):
method test_string (line 99) | def test_string(self):
class TestEntities (line 108) | class TestEntities(unittest.TestCase):
method setUp (line 110) | def setUp(self):
method test_encode_entities (line 113) | def test_encode_entities(self):
method test_decode_entities (line 125) | def test_decode_entities(self):
class TestDate (line 139) | class TestDate(unittest.TestCase):
method setUp (line 141) | def setUp(self):
method test_date (line 144) | def test_date(self):
method test_format (line 188) | def test_format(self):
method test_timestamp (line 204) | def test_timestamp(self):
method test_time (line 210) | def test_time(self):
class TestUtilityFunctions (line 224) | class TestUtilityFunctions(unittest.TestCase):
method setUp (line 226) | def setUp(self):
method test_encryption (line 229) | def test_encryption(self):
method test_json (line 239) | def test_json(self):
method test_order (line 248) | def test_order(self):
method test_avg (line 257) | def test_avg(self):
method test_variance (line 262) | def test_variance(self):
method test_stdev (line 267) | def test_stdev(self):
method test_sqlite_functions (line 272) | def test_sqlite_functions(self):
class _TestDatabase (line 303) | class _TestDatabase(object):
method setUp (line 305) | def setUp(self):
method tearDown (line 311) | def tearDown(self):
method test_escape (line 315) | def test_escape(self):
method test_database (line 343) | def test_database(self):
method test_create_table (line 360) | def test_create_table(self):
class TestDeleteMySQLDatabase (line 403) | class TestDeleteMySQLDatabase(unittest.TestCase):
method runTest (line 404) | def runTest(self):
class TestDeleteSQLiteDatabase (line 408) | class TestDeleteSQLiteDatabase(unittest.TestCase):
method runTest (line 409) | def runTest(self):
class TestMySQLDatabase (line 413) | class TestMySQLDatabase(unittest.TestCase, _TestDatabase):
method setUp (line 414) | def setUp(self):
class TestSQLiteDatabase (line 419) | class TestSQLiteDatabase(unittest.TestCase, _TestDatabase):
method setUp (line 420) | def setUp(self):
class TestSchema (line 427) | class TestSchema(unittest.TestCase):
method setUp (line 429) | def setUp(self):
method test_string (line 432) | def test_string(self):
method test_field (line 443) | def test_field(self):
method test_schema (line 471) | def test_schema(self):
class _TestTable (line 504) | class _TestTable(object):
method setUp (line 506) | def setUp(self):
method tearDown (line 528) | def tearDown(self):
method test_table (line 534) | def test_table(self):
method test_rename (line 547) | def test_rename(self):
method test_fields (line 555) | def test_fields(self):
method test_insert_update_delete (line 562) | def test_insert_update_delete(self):
method test_filter (line 611) | def test_filter(self):
method test_search (line 624) | def test_search(self):
method test_datasheet (line 630) | def test_datasheet(self):
class TestMySQLTable (line 638) | class TestMySQLTable(unittest.TestCase, _TestTable):
method setUp (line 639) | def setUp(self):
class TestSQLiteTable (line 644) | class TestSQLiteTable(unittest.TestCase, _TestTable):
method setUp (line 645) | def setUp(self):
class _TestQuery (line 652) | class _TestQuery(object):
method setUp (line 654) | def setUp(self):
method tearDown (line 678) | def tearDown(self):
method _query (line 683) | def _query(self, *args, **kwargs):
method test_abs (line 693) | def test_abs(self):
method test_cmp (line 702) | def test_cmp(self):
method test_filterchain (line 734) | def test_filterchain(self):
method test_query (line 752) | def test_query(self):
method test_xml (line 816) | def test_xml(self):
class TestMySQLQuery (line 844) | class TestMySQLQuery(unittest.TestCase, _TestQuery):
method setUp (line 845) | def setUp(self):
class TestSQLiteQuery (line 850) | class TestSQLiteQuery(unittest.TestCase, _TestQuery):
method setUp (line 851) | def setUp(self):
class _TestView (line 858) | class _TestView(object):
method setUp (line 860) | def setUp(self):
method tearDown (line 863) | def tearDown(self):
method test_view (line 868) | def test_view(self):
class TestMySQLView (line 901) | class TestMySQLView(unittest.TestCase, _TestView):
method setUp (line 902) | def setUp(self):
class TestSQLiteView (line 907) | class TestSQLiteView(unittest.TestCase, _TestView):
method setUp (line 908) | def setUp(self):
class TestCSV (line 915) | class TestCSV(unittest.TestCase):
method setUp (line 917) | def setUp(self):
method test_csv_header (line 932) | def test_csv_header(self):
method test_csv (line 941) | def test_csv(self):
method test_file (line 954) | def test_file(self):
class TestDatasheet (line 971) | class TestDatasheet(unittest.TestCase):
method setUp (line 973) | def setUp(self):
method test_rows (line 976) | def test_rows(self):
method test_columns (line 997) | def test_columns(self):
method test_column (line 1018) | def test_column(self):
method test_fields (line 1029) | def test_fields(self):
method test_group (line 1049) | def test_group(self):
method test_slice (line 1062) | def test_slice(self):
method test_copy (line 1078) | def test_copy(self):
method test_map (line 1087) | def test_map(self):
method test_json (line 1094) | def test_json(self):
method test_flip (line 1107) | def test_flip(self):
method test_truncate (line 1113) | def test_truncate(self):
method test_pprint (line 1123) | def test_pprint(self):
function suite (line 1129) | def suite(**kwargs):
FILE: test/test_de.py
class TestInflection (line 29) | class TestInflection(unittest.TestCase):
method setUp (line 31) | def setUp(self):
method test_gender (line 34) | def test_gender(self):
method test_pluralize (line 42) | def test_pluralize(self):
method test_singularize (line 54) | def test_singularize(self):
method test_attributive (line 66) | def test_attributive(self):
method test_predicative (line 87) | def test_predicative(self):
method test_find_lemma (line 99) | def test_find_lemma(self):
method test_find_lexeme (line 111) | def test_find_lexeme(self):
method test_conjugate (line 125) | def test_conjugate(self):
method test_lexeme (line 161) | def test_lexeme(self):
method test_tenses (line 172) | def test_tenses(self):
class TestParser (line 181) | class TestParser(unittest.TestCase):
method setUp (line 183) | def setUp(self):
method test_find_lemmata (line 186) | def test_find_lemmata(self):
method test_parse (line 196) | def test_parse(self):
method test_tag (line 229) | def test_tag(self):
method test_command_line (line 235) | def test_command_line(self):
function suite (line 248) | def suite():
FILE: test/test_en.py
class TestInflection (line 31) | class TestInflection(unittest.TestCase):
method setUp (line 33) | def setUp(self):
method test_indefinite_article (line 36) | def test_indefinite_article(self):
method test_pluralize (line 54) | def test_pluralize(self):
method test_singularize (line 69) | def test_singularize(self):
method test_find_lemma (line 80) | def test_find_lemma(self):
method test_find_lexeme (line 92) | def test_find_lexeme(self):
method test_conjugate (line 106) | def test_conjugate(self):
method test_lemma (line 174) | def test_lemma(self):
method test_lexeme (line 180) | def test_lexeme(self):
method test_tenses (line 194) | def test_tenses(self):
method test_comparative (line 203) | def test_comparative(self):
method test_superlative (line 208) | def test_superlative(self):
class TestQuantification (line 218) | class TestQuantification(unittest.TestCase):
method setUp (line 220) | def setUp(self):
method test_extract_leading_zeros (line 223) | def test_extract_leading_zeros(self):
method test_numerals (line 232) | def test_numerals(self):
method test_number (line 246) | def test_number(self):
method test_quantify (line 254) | def test_quantify(self):
method test_reflect (line 268) | def test_reflect(self):
class TestSpelling (line 277) | class TestSpelling(unittest.TestCase):
method test_spelling (line 279) | def test_spelling(self):
class TestParser (line 308) | class TestParser(unittest.TestCase):
method setUp (line 310) | def setUp(self):
method test_tokenize (line 313) | def test_tokenize(self):
method _test_morphological_rules (line 320) | def _test_morphological_rules(self, function=en.parser.morphology.apply):
method test_default_suffix_rules (line 341) | def test_default_suffix_rules(self):
method test_apply_morphological_rules (line 359) | def test_apply_morphological_rules(self):
method test_apply_context_rules (line 368) | def test_apply_context_rules(self):
method test_find_tags (line 383) | def test_find_tags(self):
method test_find_chunks (line 391) | def test_find_chunks(self):
method test_find_labels (line 458) | def test_find_labels(self):
method test_find_prepositions (line 470) | def test_find_prepositions(self):
method test_find_lemmata (line 496) | def test_find_lemmata(self):
method test_named_entity_recognition (line 505) | def test_named_entity_recognition(self):
method test_parse (line 513) | def test_parse(self):
method test_tagged_string (line 563) | def test_tagged_string(self):
method test_parsetree (line 573) | def test_parsetree(self):
method test_split (line 579) | def test_split(self):
method test_tag (line 585) | def test_tag(self):
method test_ngrams (line 593) | def test_ngrams(self):
method test_command_line (line 607) | def test_command_line(self):
class TestParseTree (line 620) | class TestParseTree(unittest.TestCase):
method setUp (line 622) | def setUp(self):
method test_copy (line 629) | def test_copy(self):
method test_xml (line 634) | def test_xml(self):
method test_text (line 640) | def test_text(self):
method test_sentence (line 646) | def test_sentence(self):
method test_sentence_constituents (line 661) | def test_sentence_constituents(self):
method test_slice (line 673) | def test_slice(self):
method test_chunk (line 683) | def test_chunk(self):
method test_chunk_conjunctions (line 709) | def test_chunk_conjunctions(self):
method test_chunk_modifiers (line 715) | def test_chunk_modifiers(self):
method test_pnp (line 721) | def test_pnp(self):
method test_word (line 729) | def test_word(self):
method test_word_custom_tags (line 750) | def test_word_custom_tags(self):
method test_find (line 762) | def test_find(self):
method test_zip (line 768) | def test_zip(self):
method test_unzip (line 774) | def test_unzip(self):
method test_unique (line 779) | def test_unique(self):
method test_map (line 786) | def test_map(self):
class TestModality (line 796) | class TestModality(unittest.TestCase):
method setUp (line 798) | def setUp(self):
method test_imperative (line 801) | def test_imperative(self):
method test_conditional (line 818) | def test_conditional(self):
method test_subjunctive (line 840) | def test_subjunctive(self):
method test_negated (line 852) | def test_negated(self):
method test_mood (line 861) | def test_mood(self):
method test_modality (line 876) | def test_modality(self):
class TestSentiment (line 904) | class TestSentiment(unittest.TestCase):
method setUp (line 906) | def setUp(self):
method test_sentiment_avg (line 909) | def test_sentiment_avg(self):
method test_sentiment (line 916) | def test_sentiment(self):
method test_sentiment_twitter (line 956) | def test_sentiment_twitter(self):
method test_sentiment_assessment (line 980) | def test_sentiment_assessment(self):
method test_polarity (line 987) | def test_polarity(self):
method test_subjectivity (line 993) | def test_subjectivity(self):
method test_positive (line 999) | def test_positive(self):
method test_sentiwordnet (line 1005) | def test_sentiwordnet(self):
class TestWordNet (line 1022) | class TestWordNet(unittest.TestCase):
method setUp (line 1024) | def setUp(self):
method test_normalize (line 1027) | def test_normalize(self):
method test_version (line 1033) | def test_version(self):
method test_synsets (line 1036) | def test_synsets(self):
method test_synset (line 1050) | def test_synset(self):
method test_ancenstor (line 1074) | def test_ancenstor(self):
method test_map32 (line 1081) | def test_map32(self):
method test_sentiwordnet (line 1087) | def test_sentiwordnet(self):
class TestWordlists (line 1104) | class TestWordlists(unittest.TestCase):
method setUp (line 1106) | def setUp(self):
method test_wordlist (line 1109) | def test_wordlist(self):
function suite (line 1125) | def suite():
FILE: test/test_es.py
class TestInflection (line 29) | class TestInflection(unittest.TestCase):
method setUp (line 31) | def setUp(self):
method test_pluralize (line 34) | def test_pluralize(self):
method test_singularize (line 50) | def test_singularize(self):
method test_attributive (line 66) | def test_attributive(self):
method test_predicative (line 79) | def test_predicative(self):
method test_find_lemma (line 95) | def test_find_lemma(self):
method test_find_lexeme (line 105) | def test_find_lexeme(self):
method test_conjugate (line 117) | def test_conjugate(self):
method test_lexeme (line 170) | def test_lexeme(self):
method test_tenses (line 185) | def test_tenses(self):
class TestParser (line 203) | class TestParser(unittest.TestCase):
method setUp (line 205) | def setUp(self):
method test_find_lemmata (line 208) | def test_find_lemmata(self):
method test_parse (line 224) | def test_parse(self):
method test_tag (line 249) | def test_tag(self):
method test_command_line (line 255) | def test_command_line(self):
function suite (line 268) | def suite():
FILE: test/test_fr.py
class TestInflection (line 29) | class TestInflection(unittest.TestCase):
method setUp (line 31) | def setUp(self):
method test_predicative (line 34) | def test_predicative(self):
method test_find_lemma (line 46) | def test_find_lemma(self):
method test_find_lexeme (line 56) | def test_find_lexeme(self):
method test_conjugate (line 68) | def test_conjugate(self):
method test_lexeme (line 122) | def test_lexeme(self):
method test_tenses (line 136) | def test_tenses(self):
class TestParser (line 145) | class TestParser(unittest.TestCase):
method setUp (line 147) | def setUp(self):
method test_find_prepositions (line 150) | def test_find_prepositions(self):
method test_find_lemmata (line 153) | def test_find_lemmata(self):
method test_parse (line 170) | def test_parse(self):
method test_tag (line 196) | def test_tag(self):
method test_command_line (line 202) | def test_command_line(self):
class TestSentiment (line 215) | class TestSentiment(unittest.TestCase):
method setUp (line 217) | def setUp(self):
method test_sentiment (line 220) | def test_sentiment(self):
method test_tokenizer (line 240) | def test_tokenizer(self):
function suite (line 252) | def suite():
FILE: test/test_graph.py
class TestUtilityFunctions (line 22) | class TestUtilityFunctions(unittest.TestCase):
method setUp (line 24) | def setUp(self):
method test_deepcopy (line 27) | def test_deepcopy(self):
method test_unique (line 48) | def test_unique(self):
method test_coordinates (line 55) | def test_coordinates(self):
class TestNode (line 65) | class TestNode(unittest.TestCase):
method setUp (line 67) | def setUp(self):
method test_node (line 76) | def test_node(self):
method test_edge (line 102) | def test_edge(self):
method test_flatten (line 115) | def test_flatten(self):
method test_text (line 123) | def test_text(self):
class TestEdge (line 131) | class TestEdge(unittest.TestCase):
method setUp (line 133) | def setUp(self):
method test_edge (line 140) | def test_edge(self):
class TestGraph (line 156) | class TestGraph(unittest.TestCase):
method setUp (line 158) | def setUp(self):
method test_graph (line 167) | def test_graph(self):
method test_graph_nodes (line 182) | def test_graph_nodes(self):
method test_graph_edges (line 197) | def test_graph_edges(self):
method test_cache (line 214) | def test_cache(self):
method test_paths (line 231) | def test_paths(self):
method test_eigenvector_centrality (line 255) | def test_eigenvector_centrality(self):
method test_betweenness_centrality (line 265) | def test_betweenness_centrality(self):
method test_sorted (line 275) | def test_sorted(self):
method test_prune (line 283) | def test_prune(self):
method test_fringe (line 291) | def test_fringe(self):
method test_split (line 298) | def test_split(self):
method test_update (line 304) | def test_update(self):
method test_copy (line 316) | def test_copy(self):
class TestGraphLayout (line 345) | class TestGraphLayout(unittest.TestCase):
method setUp (line 347) | def setUp(self):
method test_layout (line 356) | def test_layout(self):
class TestGraphSpringLayout (line 367) | class TestGraphSpringLayout(TestGraphLayout):
method test_layout (line 369) | def test_layout(self):
method test_distance (line 386) | def test_distance(self):
method test_repulsion (line 396) | def test_repulsion(self):
method test_attraction (line 406) | def test_attraction(self):
class TestGraphTraversal (line 420) | class TestGraphTraversal(unittest.TestCase):
method setUp (line 422) | def setUp(self):
method test_search (line 431) | def test_search(self):
method test_paths (line 449) | def test_paths(self):
method test_edges (line 463) | def test_edges(self):
method test_adjacency (line 471) | def test_adjacency(self):
method test_dijkstra_shortest_path (line 519) | def test_dijkstra_shortest_path(self):
method test_dijkstra_shortest_paths (line 531) | def test_dijkstra_shortest_paths(self):
method test_floyd_warshall_all_pairs_distance (line 565) | def test_floyd_warshall_all_pairs_distance(self):
class TestGraphPartitioning (line 583) | class TestGraphPartitioning(unittest.TestCase):
method setUp (line 585) | def setUp(self):
method test_union (line 595) | def test_union(self):
method test_intersection (line 598) | def test_intersection(self):
method test_difference (line 601) | def test_difference(self):
method test_partition (line 604) | def test_partition(self):
method test_clique (line 614) | def test_clique(self):
class TestGraphMaintenance (line 629) | class TestGraphMaintenance(unittest.TestCase):
method setUp (line 631) | def setUp(self):
method test_unlink (line 634) | def test_unlink(self):
method test_redirect (line 649) | def test_redirect(self):
method test_cut (line 661) | def test_cut(self):
method test_insert (line 673) | def test_insert(self):
class TestGraphCommonsense (line 686) | class TestGraphCommonsense(unittest.TestCase):
method setUp (line 688) | def setUp(self):
method test_halo (line 691) | def test_halo(self):
method test_field (line 704) | def test_field(self):
method test_similarity (line 713) | def test_similarity(self):
function suite (line 725) | def suite():
FILE: test/test_it.py
class TestInflection (line 29) | class TestInflection(unittest.TestCase):
method setUp (line 31) | def setUp(self):
method test_article (line 34) | def test_article(self):
method test_gender (line 60) | def test_gender(self):
method test_pluralize (line 75) | def test_pluralize(self):
method test_singularize (line 86) | def test_singularize(self):
method test_predicative (line 97) | def test_predicative(self):
method test_find_lemma (line 111) | def test_find_lemma(self):
method test_find_lexeme (line 122) | def test_find_lexeme(self):
method test_conjugate (line 134) | def test_conjugate(self):
method test_lexeme (line 190) | def test_lexeme(self):
method test_tenses (line 204) | def test_tenses(self):
class TestParser (line 213) | class TestParser(unittest.TestCase):
method setUp (line 215) | def setUp(self):
method test_find_lemmata (line 218) | def test_find_lemmata(self):
method test_parse (line 232) | def test_parse(self):
method test_tag (line 262) | def test_tag(self):
method test_command_line (line 268) | def test_command_line(self):
function suite (line 281) | def suite():
FILE: test/test_metrics.py
class TestProfiling (line 28) | class TestProfiling(unittest.TestCase):
method setUp (line 30) | def setUp(self):
method test_duration (line 38) | def test_duration(self):
method test_confustion_matrix (line 44) | def test_confustion_matrix(self):
method test_accuracy (line 53) | def test_accuracy(self):
method test_precision (line 59) | def test_precision(self):
method test_recall (line 68) | def test_recall(self):
method test_F1 (line 77) | def test_F1(self):
method test_agreement (line 84) | def test_agreement(self):
class TestTextMetrics (line 101) | class TestTextMetrics(unittest.TestCase):
method setUp (line 103) | def setUp(self):
method test_levenshtein (line 106) | def test_levenshtein(self):
method test_levenshtein_similarity (line 115) | def test_levenshtein_similarity(self):
method test_dice_coefficient (line 124) | def test_dice_coefficient(self):
method test_similarity (line 133) | def test_similarity(self):
method test_readability (line 142) | def test_readability(self):
method test_intertextuality (line 156) | def test_intertextuality(self):
method test_ttr (line 169) | def test_ttr(self):
method test_suffixes (line 176) | def test_suffixes(self):
method test_isplit (line 190) | def test_isplit(self):
method test_cooccurrence (line 197) | def test_cooccurrence(self):
class TestInterpolation (line 213) | class TestInterpolation(unittest.TestCase):
method setUp (line 215) | def setUp(self):
method test_lerp (line 218) | def test_lerp(self):
method test_smoothstep (line 224) | def test_smoothstep(self):
method test_smoothrange (line 234) | def test_smoothrange(self):
class TestStatistics (line 248) | class TestStatistics(unittest.TestCase):
method setUp (line 250) | def setUp(self):
method test_mean (line 253) | def test_mean(self):
method test_median (line 259) | def test_median(self):
method test_variance (line 270) | def test_variance(self):
method test_standard_deviation (line 279) | def test_standard_deviation(self):
method test_histogram (line 288) | def test_histogram(self):
method test_moment (line 304) | def test_moment(self):
method test_skewness (line 313) | def test_skewness(self):
method test_kurtosis (line 325) | def test_kurtosis(self):
method test_quantile (line 333) | def test_quantile(self):
method test_boxplot (line 342) | def test_boxplot(self):
class TestStatisticalTests (line 355) | class TestStatisticalTests(unittest.TestCase):
method setUp (line 357) | def setUp(self):
method test_fisher_test (line 360) | def test_fisher_test(self):
method test_chi_squared (line 368) | def test_chi_squared(self):
method test_chi_squared_p (line 389) | def test_chi_squared_p(self):
method test_kolmogorov_smirnov (line 402) | def test_kolmogorov_smirnov(self):
class TestSpecialFunctions (line 409) | class TestSpecialFunctions(unittest.TestCase):
method setUp (line 411) | def setUp(self):
method test_gamma (line 414) | def test_gamma(self):
method test_gammai (line 420) | def test_gammai(self):
method test_erfc (line 426) | def test_erfc(self):
method test_kolmogorov (line 443) | def test_kolmogorov(self):
function suite (line 455) | def suite():
FILE: test/test_nl.py
class TestInflection (line 29) | class TestInflection(unittest.TestCase):
method setUp (line 31) | def setUp(self):
method test_pluralize (line 34) | def test_pluralize(self):
method test_singularize (line 47) | def test_singularize(self):
method test_attributive (line 58) | def test_attributive(self):
method test_predicative (line 69) | def test_predicative(self):
method test_find_lemma (line 80) | def test_find_lemma(self):
method test_find_lexeme (line 92) | def test_find_lexeme(self):
method test_conjugate (line 106) | def test_conjugate(self):
method test_lexeme (line 137) | def test_lexeme(self):
method test_tenses (line 145) | def test_tenses(self):
class TestParser (line 154) | class TestParser(unittest.TestCase):
method setUp (line 156) | def setUp(self):
method test_wotan2penntreebank (line 159) | def test_wotan2penntreebank(self):
method test_find_lemmata (line 194) | def test_find_lemmata(self):
method test_parse (line 203) | def test_parse(self):
method test_tag (line 235) | def test_tag(self):
method test_command_line (line 241) | def test_command_line(self):
class TestSentiment (line 254) | class TestSentiment(unittest.TestCase):
method setUp (line 256) | def setUp(self):
method test_sentiment (line 259) | def test_sentiment(self):
function suite (line 282) | def suite():
FILE: test/test_ru.py
class TestSpelling (line 31) | class TestSpelling(unittest.TestCase):
method test_spelling (line 33) | def test_spelling(self):
function suite (line 48) | def suite():
FILE: test/test_search.py
class TestUtilityFunctions (line 23) | class TestUtilityFunctions(unittest.TestCase):
method setUp (line 25) | def setUp(self):
method test_match (line 28) | def test_match(self):
method test_unique (line 40) | def test_unique(self):
method test_find (line 43) | def test_find(self):
method test_product (line 46) | def test_product(self):
method test_variations (line 57) | def test_variations(self):
method test_odict (line 73) | def test_odict(self):
class TestTaxonomy (line 88) | class TestTaxonomy(unittest.TestCase):
method setUp (line 90) | def setUp(self):
method test_taxonomy (line 93) | def test_taxonomy(self):
method test_classifier (line 128) | def test_classifier(self):
method test_wordnet_classifier (line 139) | def test_wordnet_classifier(self):
class TestConstraint (line 153) | class TestConstraint(unittest.TestCase):
method setUp (line 155) | def setUp(self):
method _test_constraint (line 158) | def _test_constraint(self, constraint, **kwargs):
method test_fromstring (line 171) | def test_fromstring(self):
method test_match (line 229) | def test_match(self):
method test_string (line 262) | def test_string(self):
class TestPattern (line 278) | class TestPattern(unittest.TestCase):
method setUp (line 280) | def setUp(self):
method test_pattern (line 283) | def test_pattern(self):
method test_fromstring (line 293) | def test_fromstring(self):
method test_match (line 311) | def test_match(self):
method test_search (line 386) | def test_search(self):
method test_convergence (line 406) | def test_convergence(self):
method test_compile_function (line 417) | def test_compile_function(self):
method test_match_function (line 433) | def test_match_function(self):
method test_search_function (line 442) | def test_search_function(self):
method test_escape (line 450) | def test_escape(self):
class TestMatch (line 458) | class TestMatch(unittest.TestCase):
method setUp (line 460) | def setUp(self):
method test_match (line 463) | def test_match(self):
method test_group (line 490) | def test_group(self):
method test_group_ordering (line 508) | def test_group_ordering(self):
function suite (line 535) | def suite():
FILE: test/test_text.py
class TestLexicon (line 27) | class TestLexicon(unittest.TestCase):
method setUp (line 29) | def setUp(self):
method test_lazydict (line 32) | def test_lazydict(self):
method test_lazylist (line 44) | def test_lazylist(self):
method test_lexicon (line 56) | def test_lexicon(self):
class TestFrequency (line 69) | class TestFrequency(unittest.TestCase):
method setUp (line 71) | def setUp(self):
method test_frequency (line 74) | def test_frequency(self):
class TestModel (line 87) | class TestModel(unittest.TestCase):
method setUp (line 89) | def setUp(self):
method test_model (line 92) | def test_model(self):
class TestMorphology (line 108) | class TestMorphology(unittest.TestCase):
method setUp (line 110) | def setUp(self):
method test_morphology (line 113) | def test_morphology(self):
class TestContext (line 125) | class TestContext(unittest.TestCase):
method setUp (line 127) | def setUp(self):
method test_context (line 130) | def test_context(self):
class TestEntities (line 142) | class TestEntities(unittest.TestCase):
method setUp (line 144) | def setUp(self):
method test_entities (line 147) | def test_entities(self):
class TestParser (line 159) | class TestParser(unittest.TestCase):
method setUp (line 161) | def setUp(self):
method test_stringio (line 164) | def test_stringio(self):
method test_find_keywords (line 173) | def test_find_keywords(self):
method test_find_tokens (line 189) | def test_find_tokens(self):
method test_find_tags (line 202) | def test_find_tags(self):
method test_find_chunks (line 217) | def test_find_chunks(self):
class TestSentiment (line 233) | class TestSentiment(unittest.TestCase):
method setUp (line 235) | def setUp(self):
method test_dict (line 238) | def test_dict(self):
method test_bag_of_words (line 248) | def test_bag_of_words(self):
method test_annotate (line 258) | def test_annotate(self):
class TestMultilingual (line 269) | class TestMultilingual(unittest.TestCase):
method setUp (line 271) | def setUp(self):
method test_language (line 274) | def test_language(self):
method test_deflood (line 281) | def test_deflood(self):
function suite (line 290) | def suite():
FILE: test/test_vector.py
function model (line 34) | def model(top=None):
class TestUnicode (line 48) | class TestUnicode(unittest.TestCase):
method setUp (line 50) | def setUp(self):
method test_decode_utf8 (line 61) | def test_decode_utf8(self):
method test_encode_utf8 (line 67) | def test_encode_utf8(self):
class TestUtilityFunctions (line 76) | class TestUtilityFunctions(unittest.TestCase):
method setUp (line 78) | def setUp(self):
method test_shi (line 81) | def test_shi(self):
method test_shuffled (line 91) | def test_shuffled(self):
method test_chunk (line 98) | def test_chunk(self):
method test_readonlydict (line 111) | def test_readonlydict(self):
method test_readonlylist (line 124) | def test_readonlylist(self):
class TestStemmer (line 140) | class TestStemmer(unittest.TestCase):
method setUp (line 142) | def setUp(self):
method test_stem (line 171) | def test_stem(self):
method test_stem_case_sensitive (line 181) | def test_stem_case_sensitive(self):
class TestDocument (line 194) | class TestDocument(unittest.TestCase):
method setUp (line 196) | def setUp(self):
method tearDown (line 200) | def tearDown(self):
method test_stopwords (line 204) | def test_stopwords(self):
method test_words (line 210) | def test_words(self):
method test_stem (line 220) | def test_stem(self):
method test_count (line 244) | def test_count(self):
method test_document (line 264) | def test_document(self):
method test_document_load (line 289) | def test_document_load(self):
method test_document_vector (line 301) | def test_document_vector(self):
method test_document_keywords (line 324) | def test_document_keywords(self):
method test_tf (line 334) | def test_tf(self):
method test_tfidf (line 342) | def test_tfidf(self):
method test_cosine_similarity (line 353) | def test_cosine_similarity(self):
class TestModel (line 365) | class TestModel(unittest.TestCase):
method setUp (line 367) | def setUp(self):
method test_model (line 376) | def test_model(self):
method test_model_append (line 389) | def test_model_append(self):
method test_model_save (line 398) | def test_model_save(self):
method test_model_export (line 411) | def test_model_export(self):
method test_df (line 441) | def test_df(self):
method test_idf (line 448) | def test_idf(self):
method test_tfidf (line 455) | def test_tfidf(self):
method test_frequent_concept_sets (line 462) | def test_frequent_concept_sets(self):
method test_cosine_similarity (line 471) | def test_cosine_similarity(self):
method test_nearest_neighbors (line 488) | def test_nearest_neighbors(self):
method test_search (line 502) | def test_search(self):
method test_distance (line 518) | def test_distance(self):
method test_cluster (line 528) | def test_cluster(self):
method test_centroid (line 545) | def test_centroid(self):
method test_lsa (line 551) | def test_lsa(self):
method test_feature_selection (line 558) | def test_feature_selection(self):
method test_information_gain (line 576) | def test_information_gain(self):
method test_entropy (line 607) | def test_entropy(self):
method test_condensed_nearest_neighbor (line 615) | def test_condensed_nearest_neighbor(self):
method test_classifier (line 625) | def test_classifier(self):
class TestApriori (line 640) | class TestApriori(unittest.TestCase):
method setUp (line 642) | def setUp(self):
method test_apriori (line 645) | def test_apriori(self):
class TestLSA (line 662) | class TestLSA(unittest.TestCase):
method setUp (line 666) | def setUp(self):
method tearDown (line 673) | def tearDown(self):
method test_lsa (line 676) | def test_lsa(self):
method test_lsa_concepts (line 695) | def test_lsa_concepts(self):
method test_model_reduce (line 737) | def test_model_reduce(self):
class TestClustering (line 756) | class TestClustering(unittest.TestCase):
method setUp (line 760) | def setUp(self):
method t
Copy disabled (too large)
Download .json
Condensed preview — 398 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (86,325K chars).
[
{
"path": ".gitignore",
"chars": 901,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n*.pyc\n\n# C extensions\n*.so\n\n# Distribution / p"
},
{
"path": ".pylintrc",
"chars": 7334,
"preview": "[MASTER]\n\n# Specify a configuration file.\n#rcfile=\n\n# Python code to execute, usually for sys.path manipulation such as\n"
},
{
"path": ".travis.yml",
"chars": 1295,
"preview": "language: python\n\ndist: precise\n\npython:\n - \"3.6\"\n\nbefore_install:\n - export TZ=Europe/Brussels\n - if [ ${TRAVIS_PYTH"
},
{
"path": "LICENSE.txt",
"chars": 1521,
"preview": "Copyright (c) 2011-2013 University of Antwerp, Belgium\nAll rights reserved.\n\nRedistribution and use in source and binary"
},
{
"path": "README.md",
"chars": 5333,
"preview": "Pattern\n=======\n\n[](https://travis-ci.o"
},
{
"path": "__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "docs/clips.css",
"chars": 67460,
"preview": "/* --- GENERAL STYLES ------------------------------------------------------------------------------------------- */\n\n@i"
},
{
"path": "docs/html/mbsp-tags.html",
"chars": 17426,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-canvas.html",
"chars": 80887,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-db.html",
"chars": 47391,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-de.html",
"chars": 19953,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-dev.html",
"chars": 20879,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-en.html",
"chars": 52831,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-es.html",
"chars": 25570,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-fr.html",
"chars": 25605,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-graph.html",
"chars": 32979,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-it.html",
"chars": 25825,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-metrics.html",
"chars": 41259,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-nl.html",
"chars": 7915,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-search.html",
"chars": 31520,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-shell.html",
"chars": 5583,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-vector.html",
"chars": 86438,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern-web.html",
"chars": 72938,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/pattern.html",
"chars": 25134,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/html/stop-words.html",
"chars": 6639,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<he"
},
{
"path": "docs/index.html",
"chars": 64,
"preview": "<meta http-equiv=\"refresh\" content=\"0; url=html/pattern.html\" />"
},
{
"path": "docs/js/shBrushJScript.js",
"chars": 2306,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/js/shBrushPython.js",
"chars": 2865,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/js/shBrushXml.js",
"chars": 1998,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/js/shCore.css",
"chars": 6204,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/js/shCore.js",
"chars": 16175,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/js/shThemeDefault.css",
"chars": 2877,
"preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
},
{
"path": "docs/update.py",
"chars": 5102,
"preview": "#### DOCUMENTATION GENERATOR ##########################################################################\n# Keeps the offl"
},
{
"path": "examples/01-web/01-google.py",
"chars": 2022,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/02-google-translate.py",
"chars": 1051,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/03-bing.py",
"chars": 1849,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/04-twitter.py",
"chars": 2340,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/05-twitter-stream.py",
"chars": 1067,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/06-feed.py",
"chars": 1335,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/07-wikipedia.py",
"chars": 1678,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/08-wiktionary.py",
"chars": 2987,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/09-wikia.py",
"chars": 1817,
"preview": "# -*- coding: utf-8 *-*\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins im"
},
{
"path": "examples/01-web/10-dbpedia.py",
"chars": 4866,
"preview": "# -*- coding: utf-8 *-*\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins im"
},
{
"path": "examples/01-web/11-facebook.py",
"chars": 3440,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/12-dom.py",
"chars": 5757,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/13-crawler.py",
"chars": 7045,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/14-flickr.py",
"chars": 1520,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/01-web/15-sort.py",
"chars": 1328,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/02-db/01-database.py",
"chars": 3492,
"preview": "# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins im"
},
{
"path": "examples/02-db/02-datasheet.py",
"chars": 2054,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/02-db/03-date.py",
"chars": 1191,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/02-db/food.txt",
"chars": 203,
"preview": "\"id (INTEGER)\",\"name (STRING)\",\"type (STRING)\",\"color (STRING)\"\r\n\"1\",\"broccoli\",\"vegetable\",\"green\"\r\n\"2\",\"turnip\",\"vege"
},
{
"path": "examples/03-en/01-inflect.py",
"chars": 3915,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/02-quantify.py",
"chars": 1599,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/03-parse.py",
"chars": 2238,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/04-tree.py",
"chars": 1108,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/05-tagset.py",
"chars": 4669,
"preview": "# coding: utf-8\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str"
},
{
"path": "examples/03-en/06-wordnet.py",
"chars": 2452,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/07-sentiment.py",
"chars": 3357,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/08-topmine_ngrammer.py",
"chars": 1953,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/03-en/texts/1701.00002.txt",
"chars": 41354,
"preview": "The Astrophysical Journal, in press Preprint typeset using LATEX style emulateapj v. 5/2/11\n\narXiv:1701.00002v2 [astro-p"
},
{
"path": "examples/03-en/texts/1701.00003.txt",
"chars": 41024,
"preview": "Draft version March 27, 2017 Preprint typeset using LATEX style emulateapj v. 12/16/11\n\narXiv:1701.00003v2 [astro-ph.GA]"
},
{
"path": "examples/03-en/texts/1701.00004.txt",
"chars": 165395,
"preview": "Minimalist approach to the classification of symmetry protected topological phases\nZhaoxi Xiong\nDepartment of Physics, H"
},
{
"path": "examples/03-en/texts/1701.00005.txt",
"chars": 28326,
"preview": "Draft version January 3, 2017 Preprint typeset using LATEX style AASTeX6 v. 1.0\n\narXiv:1701.00005v1 [astro-ph.GA] 30 Dec"
},
{
"path": "examples/03-en/texts/1701.00006.txt",
"chars": 63036,
"preview": "arXiv:1701.00006v1 [hep-th] 30 Dec 2016\n\nTime Machines and AdS Solitons with Negative Mass\nXing-Hui Feng, Wei-Jian Geng "
},
{
"path": "examples/03-en/texts/1701.00007.txt",
"chars": 102057,
"preview": "Particle-Hole Symmetry in the Fermion-Chern-Simons and Dirac Descriptions of a Half-Filled Landau Level\nChong Wang,1 Nig"
},
{
"path": "examples/03-en/texts/1701.00008.txt",
"chars": 90303,
"preview": "Deep Neural Networks to Enable Real-time Multimessenger Astrophysics\nDaniel George1, 2 and E. A. Huerta2 1Department of "
},
{
"path": "examples/03-en/texts/1701.00009.txt",
"chars": 148654,
"preview": "arXiv:1701.00009v4 [hep-th] 30 Nov 2017\n\nGeneralization of FaddeevPopov Rules in YangMills Theories: N=3,4\nBRST Symmetri"
},
{
"path": "examples/03-en/texts/1701.00010.txt",
"chars": 121830,
"preview": "TIFR/TH/16-48\nThe shear viscosity of two-flavor crystalline color superconducting quark matter\nSreemoyee Sarkar1, 2, an"
},
{
"path": "examples/03-en/texts/1701.00011.txt",
"chars": 26808,
"preview": "Draft version January 3, 2017 Preprint typeset using LATEX style emulateapj v. 01/23/15\n\narXiv:1701.00011v1 [astro-ph.GA"
},
{
"path": "examples/03-en/texts/1701.00012.txt",
"chars": 30451,
"preview": "Draft version February 2, 2017 Preprint typeset using LATEX style emulateapj v. 01/23/15\n\narXiv:1701.00012v2 [astro-ph.E"
},
{
"path": "examples/03-en/texts/1701.00013.txt",
"chars": 55738,
"preview": "arXiv:1701.00013v3 [cond-mat.str-el] 27 Dec 2017\n\nMagnetization jump in one dimensional J - Q2 model with anisotropic ex"
},
{
"path": "examples/03-en/texts/1701.00014.txt",
"chars": 66328,
"preview": "arXiv:1701.00014v3 [hep-th] 1 Dec 2017\n\nCCNY-HEP-16/8 December 2016\nGauge-invariant Variables and Entanglement Entropy\nA"
},
{
"path": "examples/03-en/texts/1701.00015.txt",
"chars": 28813,
"preview": "Quenching preheating by light fields\nOlga Czerwinska,1 Seishi Enomoto,1, 2 and Zygmunt Lalak1 1Institute of Theoretical "
},
{
"path": "examples/03-en/texts/1701.00016.txt",
"chars": 20093,
"preview": "Non-Negative Matrix Factorization Test Cases\nConnor Sell and Jeremy Kepner Massachusetts Institute of Technology, Cambri"
},
{
"path": "examples/03-en/texts/1701.00017.txt",
"chars": 38998,
"preview": "arXiv:1701.00017v1 [gr-qc] 30 Dec 2016\n\nQuantum Foam, Gravitational Thermodynamics, and\nthe Dark Sector\nY. Jack Ng\nInsti"
},
{
"path": "examples/03-en/texts/1701.00018.txt",
"chars": 102382,
"preview": "THE KPZ FIXED POINT\nKONSTANTIN MATETSKI, JEREMY QUASTEL, AND DANIEL REMENIK\nABSTRACT. An explicit Fredholm determinant f"
},
{
"path": "examples/03-en/texts/1701.00019.txt",
"chars": 23763,
"preview": "Technical Report: Optimal Surveillance of Dynamic Parades using Teams of Aerial Robots\nKostas Alexis\n\narXiv:1701.00019v1"
},
{
"path": "examples/03-en/texts/1701.00020.txt",
"chars": 51049,
"preview": "arXiv:1701.00020v2 [math.OA] 19 Apr 2017\n\nBRAIDED MULTIPLICATIVE UNITARIES AS REGULAR OBJECTS\nRALF MEYER AND SUTANU ROY\n"
},
{
"path": "examples/03-en/texts/1701.00021.txt",
"chars": 67090,
"preview": "JOURNAL OF LATEX CLASS FILES, VOL. 14, NO. 8, AUGUST 2015\n\n1\n\nDistributed Finite-Time Termination of Consensus in the Pr"
},
{
"path": "examples/03-en/texts/1701.00022.txt",
"chars": 38763,
"preview": "H. Miao et al., PNAS 114, 12430-12435 (2017)\nHigh-temperature charge density wave\ncorrelations in La1.875Ba0.125CuO4 wit"
},
{
"path": "examples/03-en/texts/1701.00023.txt",
"chars": 59411,
"preview": "arXiv:1701.00023v1 [quant-ph] 30 Dec 2016\n\nTransient chaos - a resolution of breakdown of quantum-classical corresponden"
},
{
"path": "examples/03-en/texts/1701.00024.txt",
"chars": 37584,
"preview": "arXiv:1701.00024v2 [astro-ph.GA] 26 Oct 2017\n\nDraft version October 27, 2017 Preprint typeset using LATEX style AASTeX6 "
},
{
"path": "examples/03-en/texts/1701.00025.txt",
"chars": 77210,
"preview": "arXiv:1701.00025v2 [physics.flu-dyn] 21 Sep 2017\n\n1\nNonmodal stability analysis of the boundary layer under solitary wav"
},
{
"path": "examples/03-en/texts/1701.00026.txt",
"chars": 41593,
"preview": "arXiv:1701.00026v1 [math.RA] 30 Dec 2016\n\nALMOST PROJECTIVE AND ALMOST INJECTIVE MODULES\nABYZOV A. N.\nAbstract. We descr"
},
{
"path": "examples/03-en/texts/1701.00027.txt",
"chars": 41643,
"preview": "arXiv:1701.00027v2 [math.AG] 16 Nov 2017\n\nBETTI NUMBERS AND PSEUDOEFFECTIVE CONES IN 2-FANO VARIETIES\nGIOSU EMANUELE MUR"
},
{
"path": "examples/03-en/texts/1701.00028.txt",
"chars": 61968,
"preview": "Nonlinear response of biased bilayer graphene at terahertz frequencies\nRiley McGouran1 and Marc M. Dignam1 1Department o"
},
{
"path": "examples/03-en/texts/1701.00029.txt",
"chars": 52716,
"preview": "Identification-robust moment-based tests for Markov-switching in autoregressive models \n\nJean-Marie Dufour McGill Unive"
},
{
"path": "examples/03-en/texts/1701.00030.txt",
"chars": 51727,
"preview": "arXiv:1701.00030v1 [q-fin.CP] 30 Dec 2016\n\nNumerical analysis of an extended structural default model with mutual liabil"
},
{
"path": "examples/03-en/texts/1701.00031.txt",
"chars": 42956,
"preview": "1\nSuper-Resolution Reconstruction of Electrical Impedance Tomography Images\nR. A. Borsoi, J. C. C. Aya, G. H. Costa, J. "
},
{
"path": "examples/03-en/texts/1701.00032.txt",
"chars": 16303,
"preview": "arXiv:1701.00032v1 [physics.flu-dyn] 30 Dec 2016\n\nShock-driven transition to turbulence: emergence of power-law scaling\n"
},
{
"path": "examples/03-en/texts/1701.00033.txt",
"chars": 79486,
"preview": "Stochastic Artificial Potentials for Online Safe Navigation\nSantiago Paternain and Alejandro Ribeiro\n\narXiv:1701.00033v1"
},
{
"path": "examples/03-en/texts/1701.00034.txt",
"chars": 63267,
"preview": "arXiv:1701.00034v1 [math.AP] 30 Dec 2016\n\nTOPOLOGY AND NESTING OF THE ZERO SET COMPONENTS OF MONOCHROMATIC RANDOM WAVES\n"
},
{
"path": "examples/03-en/texts/1701.00035.txt",
"chars": 61589,
"preview": "Magnetism, transport and thermodynamics in two-dimensional half-filled Hubbard superlattices\nRubem Mondaini1 and Thereza"
},
{
"path": "examples/03-en/texts/1701.00037.txt",
"chars": 150500,
"preview": "arXiv:1701.00037v2 [gr-qc] 7 Mar 2017\n\nJanisNewman algorithm: generating rotating and NUT charged black holes\nHarold Erb"
},
{
"path": "examples/03-en/texts/1701.00038.txt",
"chars": 105924,
"preview": "Sparsity enabled cluster reduced-order models for control\nEurika Kaisera,, Marek Morzynskib, Guillaume Davillerc, J. Nat"
},
{
"path": "examples/03-en/texts/1701.00039.txt",
"chars": 56180,
"preview": "RANK STRUCTURED APPROXIMATION METHOD FOR QUASIPERIODIC ELLIPTIC PROBLEMS\nB. KHOROMSKIJ AND S. REPIN\n\narXiv:1701.00039v1 "
},
{
"path": "examples/03-en/texts/1701.00043.txt",
"chars": 29870,
"preview": "draft November 26 2016 Preprint typeset using LATEX style emulateapj v. 01/23/15\n\narXiv:1701.00043v1 [astro-ph.GA] 31 De"
},
{
"path": "examples/03-en/texts/1701.00044.txt",
"chars": 25075,
"preview": "STIRLING FUNCTIONS AND A GENERALIZATION OF WILSON'S THEOREM\nMATTHEW A WILLIAMS\n\narXiv:1701.00044v1 [math.NT] 31 Dec 2016"
},
{
"path": "examples/03-en/texts/1701.00045.txt",
"chars": 84310,
"preview": "Signatures of spatially correlated noise and non-secular effects\nin two-dimensional electronic spectroscopy\nJames Lim,1,"
},
{
"path": "examples/03-en/texts/1701.00046.txt",
"chars": 56437,
"preview": "arXiv:1701.00046v1 [hep-th] 31 Dec 2016\n\nPreprint number: YITP-16-128, MPP-2016-335, OU-HET-917\nFlow equation for the sc"
},
{
"path": "examples/03-en/texts/1701.00047.txt",
"chars": 25449,
"preview": "arXiv:1701.00047v3 [math.FA] 22 Jun 2017\n\nGABOR TIGHT FUSION FRAMES: CONSTRUCTION AND APPLICATIONS IN SIGNAL RETRIEVAL M"
},
{
"path": "examples/03-en/texts/1701.00049.txt",
"chars": 26633,
"preview": "arXiv:1701.00049v1 [hep-th] 31 Dec 2016\n\nFlat Space Amplitudes and Conformal Symmetry of the Celestial Sphere\nSabrina Pa"
},
{
"path": "examples/03-en/texts/1701.00050.txt",
"chars": 46475,
"preview": "arXiv:1701.00050v2 [quant-ph] 13 Apr 2017\n\nPrepared for submission to JHEP\nEntanglement renormalization, quantum error c"
},
{
"path": "examples/03-en/texts/1701.00051.txt",
"chars": 26385,
"preview": "arXiv:1701.00051v1 [hep-th] 31 Dec 2016\n\nProg. Theor. Exp. Phys. 2012, 00000 (14ages) DOI: 10.1093/ptep/0000000000\nSuper"
},
{
"path": "examples/03-en/texts/1701.00052.txt",
"chars": 38031,
"preview": "arXiv:1701.00052v2 [math.PR] 5 Dec 2017\n\nOptimal selection of the k-th best candidate\nYi-Shen Lin, Shoou-Ren Hsiau, and "
},
{
"path": "examples/03-en/texts/1701.00053.txt",
"chars": 8385,
"preview": "NEWS & VIEWS\n\narXiv:1701.00053v1 [astro-ph.SR] 31 Dec 2016\n\nStar clusters: Anything but simple\nRichard de Grijs1,2,3\n\n1K"
},
{
"path": "examples/03-en/texts/1701.00054.txt",
"chars": 40482,
"preview": "arXiv:1701.00054v3 [cond-mat.str-el] 8 Dec 2017\n\nStripe order in the underdoped region of the two-dimensional Hubbard mo"
},
{
"path": "examples/03-en/texts/1701.00055.txt",
"chars": 82267,
"preview": "High order local absorbing boundary conditions for acoustic waves in terms of farfield expansions\nVianey Villamizar,a, S"
},
{
"path": "examples/03-en/texts/1701.00056.txt",
"chars": 17962,
"preview": "Compressed sensing and optimal denoising of monotone signals\nEftychios A. Pnevmatikakis Center for Computational Biology"
},
{
"path": "examples/03-en/texts/1701.00057.txt",
"chars": 35043,
"preview": "Lorentz quantum mechanics\nQi Zhang( )1 and Biao Wu( )2, 3, 4, 5 1College of Science, Zhejiang University of Technology, "
},
{
"path": "examples/03-en/texts/1701.00058.txt",
"chars": 36975,
"preview": "arXiv:1701.00058v1 [math.AC] 31 Dec 2016\n\nTHREE FAMILIES OF DENSE PUISEUX MONOIDS\nFELIX GOTTI, MARLY GOTTI, AND HAROLD P"
},
{
"path": "examples/03-en/texts/1701.00060.txt",
"chars": 28246,
"preview": "Einstein static universe from GUP\nK. Atazadeh and F. Darabi Department of Physics, Azarbaijan Shahid Madani University, "
},
{
"path": "examples/03-en/texts/1701.00061.txt",
"chars": 11203,
"preview": "PRIMITIVE AUTOMORPHISMS OF A SIMPLE ABELIAN VARIETY\nKEIJI OGUISO\n\narXiv:1701.00061v1 [math.AG] 31 Dec 2016\n\nAbstract. We"
},
{
"path": "examples/03-en/texts/1701.00062.txt",
"chars": 83855,
"preview": "Finite-size analysis of the detectability limit of the stochastic block model\nJean-Gabriel Young,1, Patrick Desrosiers,"
},
{
"path": "examples/03-en/texts/1701.00063.txt",
"chars": 25551,
"preview": "arXiv:1701.00063v4 [hep-th] 15 Nov 2017\n\nNovember 16, 2017\nStress tensor correlators of CCFT2 using flat-space holograph"
},
{
"path": "examples/03-en/texts/1701.00064.txt",
"chars": 22139,
"preview": "An Entropic Measure of Nonclassicality of Single Mode Quantum Light\nSoumyakanti Bose S. N. Bose National Centre for Basi"
},
{
"path": "examples/03-en/texts/1701.00065.txt",
"chars": 31280,
"preview": "Workshop In-Memory and In-Storage Computing with Emerging Technologies at PACT 2016\n\narXiv:1701.00065v1 [cs.ET] 31 Dec 2"
},
{
"path": "examples/03-en/texts/1701.00066.txt",
"chars": 14603,
"preview": "A POS Tagger for Code Mixed Indian Social Media Text -- ICON-2016 NLP Tools Contest Entry from Surukam\nSree Harsha Rames"
},
{
"path": "examples/03-en/texts/1701.00067.txt",
"chars": 63275,
"preview": "arXiv:1701.00067v2 [hep-ph] 13 Sep 2017\n\nPrepared for submission to JHEP\nBlack Holes, Dark Matter Spikes, and Constraint"
},
{
"path": "examples/03-en/texts/1701.00068.txt",
"chars": 51746,
"preview": "arXiv:1701.00068v1 [math.NA] 31 Dec 2016\n\nThe Discrete Stochastic Galerkin Method for Hyperbolic Equations with Non-smoo"
},
{
"path": "examples/03-en/texts/1701.00069.txt",
"chars": 52551,
"preview": "arXiv:1701.00069v1 [math-ph] 31 Dec 2016\n\nWhitham modulation equations and application to small dispersion asymptotics a"
},
{
"path": "examples/03-en/texts/1701.00072.txt",
"chars": 49353,
"preview": "arXiv:1701.00072v1 [cs.DB] 31 Dec 2016\n\nGraph or Relational Databases: A Speed Comparison for Process Mining Algorithm\nJ"
},
{
"path": "examples/03-en/texts/1701.00073.txt",
"chars": 67984,
"preview": "arXiv:1701.00073v1 [math.RT] 31 Dec 2016\n\nCATEGORICAL RESOLUTIONS OF BOUNDED DERIVED CATEGORIES\nJAVAD ASADOLLAHI, RASOOL"
},
{
"path": "examples/03-en/texts/1701.00074.txt",
"chars": 58687,
"preview": "Spin Transport and Accumulation in a 2D Weyl Fermion System\n\nT. Tzen Ong1, 2 and Naoto Nagaosa1, 2\n1RIKEN Center for Eme"
},
{
"path": "examples/03-en/texts/1701.00075.txt",
"chars": 17456,
"preview": "arXiv:1701.00075v1 [math.GN] 31 Dec 2016\n\nExtending Baire-one functions on compact spaces\nOlena Karlova, Volodymyr Mykha"
},
{
"path": "examples/03-en/texts/1701.00076.txt",
"chars": 19435,
"preview": "arXiv:1701.00076v1 [math.CA] 31 Dec 2016\n\nLocal Stable Manifold theorem for fractional systems revisited\nAmey Deshpande\n"
},
{
"path": "examples/03-en/texts/1701.00077.txt",
"chars": 50553,
"preview": "arXiv:1701.00077v1 [q-bio.QM] 31 Dec 2016\n\nLearning Weighted Association Rules in Human\nPhenotype Ontology.\nPietro Hiram"
},
{
"path": "examples/03-en/texts/1701.00078.txt",
"chars": 11569,
"preview": "arXiv:1701.00078v2 [math.FA] 13 Feb 2017\n\nTHE STRUCTURE OF A-FREE MEASURES WITH UNIFORMLY SINGULAR PART\nD. MITROVIC\n\nAbs"
},
{
"path": "examples/03-en/texts/1701.00079.txt",
"chars": 37721,
"preview": "arXiv:1701.00079v2 [gr-qc] 15 Mar 2017\n\nShadows of Einstein-dilaton-Gauss-Bonnet black holes\nPedro V. P. Cunha1,2, Carlo"
},
{
"path": "examples/03-en/texts/1701.00081.txt",
"chars": 38374,
"preview": "Dissipative stabilization of quantum-feedback-based multipartite entanglement with Rydberg atoms\nXiao-Qiang Shao,1 Jin-H"
},
{
"path": "examples/03-en/texts/1701.00082.txt",
"chars": 347395,
"preview": "arXiv:1701.00082v1 [q-bio.NC] 31 Dec 2016\n\nA computational investigation of the relationships between single-neuron and "
},
{
"path": "examples/03-en/texts/1701.00083.txt",
"chars": 375514,
"preview": "arXiv:1701.00083v1 [hep-ph] 31 Dec 2016\n\nEfectos de Temperatura Finita y Curvatura en QCD\ny Modelos de Quarks Quirales\nE"
},
{
"path": "examples/03-en/texts/1701.00084.txt",
"chars": 40567,
"preview": "arXiv:1701.00084v1 [math.GN] 31 Dec 2016\n\nPRODUCTS OF TOPOLOGICAL GROUPS IN WHICH ALL CLOSED SUBGROUPS ARE SEPARABLE\nARK"
},
{
"path": "examples/03-en/texts/1701.00085.txt",
"chars": 26794,
"preview": "arXiv:1701.00085v2 [hep-th] 16 Jan 2017\n\nAnomalous transport and massive gravity theories\nEugenio Megias1,2\n1Max-Planck-"
},
{
"path": "examples/03-en/texts/1701.00086.txt",
"chars": 19176,
"preview": "XXV European Cosmic Ray Symposium, Turin, Sept. 4-9 2016\n\n1\n\nPrecision measurement of antiproton to proton ratio with th"
},
{
"path": "examples/03-en/texts/1701.00087.txt",
"chars": 19355,
"preview": "EPJ Web of Conferences will be set by the publisher DOI: will be set by the publisher c Owned by the authors, published "
},
{
"path": "examples/03-en/texts/1701.00088.txt",
"chars": 18487,
"preview": "arXiv:1701.00088v1 [cond-mat.soft] 31 Dec 2016\n\nExactly solvable model for self-assembly of hard core - soft shell parti"
},
{
"path": "examples/03-en/texts/1701.00089.txt",
"chars": 36206,
"preview": "Viability theorem for deterministic mean field type control systems\nYurii Averboukhab\n\narXiv:1701.00089v3 [math.OC] 11 A"
},
{
"path": "examples/03-en/texts/1701.00090.txt",
"chars": 55342,
"preview": "arXiv:1701.00090v3 [math.OC] 13 Apr 2017\n\nTwo-stage robust optimization for orienteering problem with stochastic weights"
},
{
"path": "examples/03-en/texts/1701.00091.txt",
"chars": 47943,
"preview": "The Rotating Vicsek Model: Pattern Formation and Enhanced Flocking in Chiral Active Matter\nBenno Liebchen1, and Demian "
},
{
"path": "examples/03-en/texts/1701.00092.txt",
"chars": 19971,
"preview": "arXiv:1701.00092v1 [math.FA] 31 Dec 2016\n\nHERMITE-HADAMARD, HERMITE-HADAMARD-FEJER, DRAGOMIR-AGARWAL AND PACHPATTE TYPE\n"
},
{
"path": "examples/03-en/texts/1701.00094.txt",
"chars": 42229,
"preview": "arXiv:1701.00094v1 [physics.ins-det] 31 Dec 2016\n\nPhase Noise and Jitter in Digital Electronics\nClaudio E. Calossoand En"
},
{
"path": "examples/03-en/texts/1701.00095.txt",
"chars": 98786,
"preview": "arXiv:1701.00095v1 [cond-mat.soft] 31 Dec 2016\n\nA new class of plastic flow evolution equations for anisotropic multipli"
},
{
"path": "examples/03-en/texts/1701.00096.txt",
"chars": 63322,
"preview": "arXiv:1701.00096v4 [q-bio.NC] 10 Mar 2017\n\nLoss of brain inter-frequency hubs in Alzheimer's disease\nJ. Guillona,b, Y. A"
},
{
"path": "examples/03-en/texts/1701.00097.txt",
"chars": 56023,
"preview": "arXiv:1701.00097v1 [math.OA] 31 Dec 2016\n\nTUBE ALGEBRA OF GROUP-TYPE SUBFACTORS\nDietmar Bisch, Paramita Das, Shamindra K"
},
{
"path": "examples/03-en/texts/1701.00098.txt",
"chars": 29350,
"preview": "arXiv:1701.00098v1 [hep-th] 31 Dec 2016\n\nEPJ Web of Conferences will be set by the publisher DOI: will be set by the pub"
},
{
"path": "examples/03-en/texts/1701.00099.txt",
"chars": 23575,
"preview": "arXiv:1701.00099v3 [nucl-th] 10 Mar 2017\n\nForward-backward multiplicity correlations at the LHC from independent sources"
},
{
"path": "examples/03-en/texts/1701.00100.txt",
"chars": 16837,
"preview": "1\n \n. . \n\narXiv:1701.00100v1 [math.CA] 31 Dec 2016\n\n, x ( ) ln-1 x (\n ) x i , i = -1"
},
{
"path": "examples/03-en/texts/1701.00101.txt",
"chars": 80736,
"preview": "WIENER'S LEMMA ALONG PRIMES AND OTHER SUBSEQUENCES\nCHRISTOPHE CUNY, TANJA EISNER, AND BA LINT FARKAS\n\narXiv:1701.00101v4"
},
{
"path": "examples/03-en/texts/1701.00102.txt",
"chars": 38493,
"preview": "Mon. Not. R. Astron. Soc. 000, 1?? (2016) Printed 3 January 2017 (MN LATEX style file v2.2)\nSuzaku Analysis of the Super"
},
{
"path": "examples/03-en/texts/1701.00103.txt",
"chars": 25236,
"preview": "arXiv:1701.00103v1 [math.DS] 31 Dec 2016\n\nOn the solutions of a second-order difference\nequations in terms of generalize"
},
{
"path": "examples/03-en/texts/1701.00104.txt",
"chars": 29145,
"preview": "arXiv:1701.00104v1 [cs.CR] 31 Dec 2016\n\nOn The Security Evaluation of Partial Password Implementations\nTheodosis Mourouz"
},
{
"path": "examples/03-en/texts/1701.00105.txt",
"chars": 28682,
"preview": "arXiv:1701.00105v1 [astro-ph.HE] 31 Dec 2016\n\nXXV European Cosmic Ray Symposium, Turin, Sept. 4-9 2016\n\n1\n\nElectron Acce"
},
{
"path": "examples/03-en/texts/1701.00106.txt",
"chars": 20984,
"preview": "arXiv:1701.00106v1 [physics.optics] 31 Dec 2016\n\nIn-situ tuning of whispering gallery modes of levitated silica microsph"
},
{
"path": "examples/03-en/texts/1701.00107.txt",
"chars": 75070,
"preview": "arXiv:1701.00107v1 [math.PR] 31 Dec 2016\n\nTOWARDS A UNIVERSALITY PICTURE FOR THE RELAXATION TO EQUILIBRIUM OF KINETICALL"
},
{
"path": "examples/03-en/texts/1701.00109.txt",
"chars": 64053,
"preview": "arXiv:1701.00109v1 [math.NA] 31 Dec 2016\n\nELASTIC SPLINES II: UNICITY OF OPTIMAL S-CURVES AND G2 REGULARITY OF SPLINES\nA"
},
{
"path": "examples/03-en/texts/1701.00110.txt",
"chars": 32313,
"preview": "arXiv:1701.00110v1 [cond-mat.mtrl-sci] 31 Dec 2016\n\nFirst-Principles Study of Exchange Interactions of Yttrium Iron Garn"
},
{
"path": "examples/03-en/texts/1701.00111.txt",
"chars": 98022,
"preview": "A functional limit theorem for the sine-process\nAlexander I. Bufetov1,2,3,4,5 and Andrey V. Dymov2,3\n1Aix-Marseille Univ"
},
{
"path": "examples/03-en/texts/1701.00112.txt",
"chars": 39393,
"preview": "arXiv:1701.00112v3 [q-fin.PR] 5 Mar 2017\n\nMultinomial method for option pricing under Variance Gamma\nNicola Cantarutti ,"
},
{
"path": "examples/04-search/01-search.py",
"chars": 1871,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/02-constraint.py",
"chars": 2667,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/03-lemmata.py",
"chars": 1257,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/04-taxonomy.py",
"chars": 2726,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/05-multiple.py",
"chars": 1012,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/06-optional.py",
"chars": 1782,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/07-exclude.py",
"chars": 1972,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/08-group.py",
"chars": 1901,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/04-search/09-web.py",
"chars": 1454,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/05-vector/01-document.py",
"chars": 3340,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/05-vector/02-model.py",
"chars": 3268,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/05-vector/03-lsa.py",
"chars": 3948,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom buil"
},
{
"path": "examples/05-vector/04-KNN.py",
"chars": 3471,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/05-vector/05-nb.py",
"chars": 2645,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom buil"
},
{
"path": "examples/05-vector/06-svm.py",
"chars": 4191,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom buil"
},
{
"path": "examples/05-vector/07-slp.py",
"chars": 6065,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nfrom buil"
},
{
"path": "examples/05-vector/corpus/badger.txt",
"chars": 16022,
"preview": "Badgers, occasionally referred to as brocks, are short-legged, heavy-set omnivores in the weasel biological family, Must"
},
{
"path": "examples/05-vector/corpus/bear.txt",
"chars": 42925,
"preview": "Bears are mammals of the family Ursidae. Bears are classified as caniforms, or doglike carnivorans, with the pinnipeds b"
},
{
"path": "examples/05-vector/corpus/dog.txt",
"chars": 83644,
"preview": "The dog (Canis lupus familiaris [1]) is a domesticated form of the gray wolf, a member of the Canidae family of the orde"
},
{
"path": "examples/05-vector/corpus/dolphin.txt",
"chars": 40019,
"preview": "Dolphins are marine mammals that are closely related to whales and porpoises. There are almost forty species of dolphin "
},
{
"path": "examples/05-vector/corpus/lion.txt",
"chars": 93942,
"preview": "The lion (Panthera leo) is one of the four big cats in the genus Panthera, and a member of the family Felidae. With some"
},
{
"path": "examples/05-vector/corpus/parakeet.txt",
"chars": 1821,
"preview": "Parakeet is a term for any one of a large number of unrelated small to medium sized species of parrot, that generally ha"
},
{
"path": "examples/05-vector/corpus/rabbit.txt",
"chars": 25397,
"preview": "Rabbits are small mammals in the family Leporidae of the order Lagomorpha, found in several parts of the world. There ar"
},
{
"path": "examples/05-vector/corpus/shark.txt",
"chars": 56532,
"preview": "Sharks (superorder Selachimorpha) are a type of fish with a full cartilaginous skeleton and a highly streamlined body. T"
},
{
"path": "examples/05-vector/corpus/sparrow.txt",
"chars": 6925,
"preview": "True sparrows, the Old World sparrows in the family Passeridae, are small passerine birds. As eight or more species nest"
},
{
"path": "examples/05-vector/corpus/tiger.txt",
"chars": 76430,
"preview": "The tiger (Panthera tigris), a member of the Felidae family, is the largest of the four \"big cats\" in the genus Panthera"
},
{
"path": "examples/05-vector/corpus/wolf.txt",
"chars": 92795,
"preview": "The gray wolf or grey wolf (Canis lupus), often known simply as the wolf, is the largest wild member of the Canidae fami"
},
{
"path": "examples/06-graph/01-graph.py",
"chars": 1098,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/02-export.py",
"chars": 2326,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/03-template.py",
"chars": 1345,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/04-canvas.html",
"chars": 3046,
"preview": "<!-- This example demonstrates the JavaScript source code generated by pattern.graph's export().\n It is a combinatio"
},
{
"path": "examples/06-graph/05-trends.py",
"chars": 1560,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/06-commonsense.py",
"chars": 2601,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/07-graphml.py",
"chars": 968,
"preview": "from __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom builtins import str, bytes, dict, in"
},
{
"path": "examples/06-graph/test.graphml",
"chars": 12087,
"preview": "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\">\n <key attr.name=\"weight\" attr.type=\"double\" for=\"edge\" id=\"edge"
},
{
"path": "examples/07-canvas/01-basic.html",
"chars": 1236,
"preview": "<!doctype html>\n<html>\n<head>\n\t<title>canvas.js | basics (1)</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html"
},
{
"path": "examples/07-canvas/02-basic.html",
"chars": 822,
"preview": "<!doctype html>\n<html>\n<head>\n\t<title>canvas.js | basics (2)</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html"
},
{
"path": "examples/07-canvas/03-transformation.html",
"chars": 2400,
"preview": "<!doctype html>\n<html>\n<head>\n\t<title>canvas.js | transformations</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text"
},
{
"path": "examples/07-canvas/04-path.html",
"chars": 1967,
"preview": "<!doctype html>\n<html>\n<head>\n\t<title>canvas.js | paths</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; cha"
},
{
"path": "examples/07-canvas/05-points.html",
"chars": 3097,
"preview": "<!doctype html>\n<html>\n<head>\n\t<title>canvas.js | path points</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/htm"
}
]
// ... and 198 more files (download for full content)
About this extraction
This page contains the full source code of the clips/pattern GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 398 files (79.5 MB), approximately 20.9M tokens, and a symbol index with 3178 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.