|
| 1 | +#### PATTERN | RU ################################################################################## |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# Copyright (c) 2010 University of Antwerp, Belgium |
| 4 | +# Author: Tom De Smedt <tom@organisms.be> |
| 5 | +# License: BSD (see LICENSE.txt for details). |
| 6 | +# http://www.clips.ua.ac.be/pages/pattern |
| 7 | + |
| 8 | +#################################################################################################### |
| 9 | +# English linguistical tools using fast regular expressions. |
| 10 | + |
| 11 | +from __future__ import unicode_literals |
| 12 | +from __future__ import division |
| 13 | + |
| 14 | +from builtins import str, bytes, dict, int |
| 15 | +from builtins import map, zip, filter |
| 16 | +from builtins import object, range |
| 17 | + |
| 18 | +import os |
| 19 | +import sys |
| 20 | + |
| 21 | +try: |
| 22 | + MODULE = os.path.dirname(os.path.realpath(__file__)) |
| 23 | +except: |
| 24 | + MODULE = "" |
| 25 | + |
| 26 | +sys.path.insert(0, os.path.join(MODULE, "..", "..", "..", "..")) |
| 27 | + |
| 28 | +# Import parser base classes. |
| 29 | +from pattern.text import ( |
| 30 | + Lexicon, Model, Morphology, Context, Parser as _Parser, ngrams, pprint, commandline, |
| 31 | + PUNCTUATION |
| 32 | +) |
| 33 | +# Import parser universal tagset. |
| 34 | +from pattern.text import ( |
| 35 | + penntreebank2universal, |
| 36 | + PTB, PENN, UNIVERSAL, |
| 37 | + NOUN, VERB, ADJ, ADV, PRON, DET, PREP, ADP, NUM, CONJ, INTJ, PRT, PUNC, X |
| 38 | +) |
| 39 | +# Import parse tree base classes. |
| 40 | +from pattern.text.tree import ( |
| 41 | + Tree, Text, Sentence, Slice, Chunk, PNPChunk, Chink, Word, table, |
| 42 | + SLASH, WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA, AND, OR |
| 43 | +) |
| 44 | +# Import sentiment analysis base classes. |
| 45 | +from pattern.text import ( |
| 46 | + Sentiment as _Sentiment, NOUN, VERB, ADJECTIVE, ADVERB |
| 47 | +) |
| 48 | +# Import spelling base class. |
| 49 | +from pattern.text import ( |
| 50 | + Spelling |
| 51 | +) |
| 52 | +# Import verb tenses. |
| 53 | +from pattern.text import ( |
| 54 | + INFINITIVE, PRESENT, PAST, FUTURE, |
| 55 | + FIRST, SECOND, THIRD, |
| 56 | + SINGULAR, PLURAL, SG, PL, |
| 57 | + PROGRESSIVE, |
| 58 | + PARTICIPLE |
| 59 | +) |
| 60 | +# Import inflection functions. |
| 61 | +from pattern.text.en.inflect import ( |
| 62 | + article, referenced, DEFINITE, INDEFINITE, |
| 63 | + pluralize, singularize, NOUN, VERB, ADJECTIVE, |
| 64 | + grade, comparative, superlative, COMPARATIVE, SUPERLATIVE, |
| 65 | + verbs, conjugate, lemma, lexeme, tenses, |
| 66 | + predicative, attributive |
| 67 | +) |
| 68 | +# Import quantification functions. |
| 69 | +from pattern.text.en.inflect_quantify import ( |
| 70 | + number, numerals, quantify, reflect |
| 71 | +) |
| 72 | +# Import mood & modality functions. |
| 73 | +from pattern.text.en.modality import ( |
| 74 | + mood, INDICATIVE, IMPERATIVE, CONDITIONAL, SUBJUNCTIVE, |
| 75 | + modality, uncertain, EPISTEMIC, |
| 76 | + negated |
| 77 | +) |
| 78 | +# Import all submodules. |
| 79 | +from pattern.text.en import inflect |
| 80 | +from pattern.text.en import wordnet |
| 81 | +from pattern.text.en import wordlist |
| 82 | + |
| 83 | +sys.path.pop(0) |
| 84 | + |
0 commit comments