code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# Copyright 2012 Google Inc. All Rights Reserved.
"""Server root."""
__author__ = 'jason.stredwick@gmail.com (Jason Stredwick)'
import os
ROOT = os.path.dirname(__file__)
| Python |
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# -*- mode: python; -*-
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Python |
# -*- mode: python; -*-
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python |
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python |
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.template import loader, Context, RequestContext
from django.template.defaultfilters import slugify
from django.shortcuts import render_to_response
from django import forms
def redirect(view, params):
return HttpRe... | Python |
#!/usr/bin/env python2.4
import os, urllib, time
CATEGORIES = (
"General",
"People",
"Objects",
"Dates",
)
fin = open("pages.list", 'r')
categories = {}
current = None
for line in fin:
line = line.strip()
if line[:2] == '--' and line[-2:] == '--':
current = line[2:-2]
if current not in categories:... | Python |
#!/usr/bin/env python2.4
import os, urllib, time
CATEGORIES = (
"General",
"People",
"Objects",
"Dates",
)
fin = open("pages.list", 'r')
categories = {}
current = None
for line in fin:
line = line.strip()
if line[:2] == '--' and line[-2:] == '--':
current = line[2:-2]
if current not in categories:... | Python |
#!/usr/bin/env python2.4
import os, pickle
import nltk
import knowledge, parse
CATEGORIES = (
"General",
"People",
"Objects",
"Dates",
)
EXCLUDE = (
"Bad Cases",
)
CREATION_VERBS = (
'painted',
'paints',
'wrote',
'writes',
'built',
'builds',
'created',
'creates',
'sculpted',
'sculpts... | Python |
###############################################################################
"""
understand.py
this module is offically up and running. though changes may be made the
return type and format is going to stay the same.
input is raw text entered by the user. this is first processed to see if
the user ... | Python |
import os, pickle
MONTHS = [
"ZERO",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
]
def nonrecursive(function):
'''
A decorator constructor for methods that forces them to return '...' if
they're called recurs... | Python |
import manage, sys
manager = manage.Manager()
try: manager.converse()
except KeyboardInterrupt:
sys.exit() | Python |
from knowledge import *
x = Event(
name="a terrible tragedy",
)
print type(x)
y = Person(
name="Bond, James Bond",
birth=Event(
name="the birth of 'none'",
when=Date(1564, 3, 4)
),
)
x.instigators.add(y)
print [str(i) for i in x.instigators]
print x.instigators.pop().birth.start
print [str(i) for i in... | Python |
# OGDEN - last updated for NodeBox 1.9.4
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on Charles K. Ogden list of basic English words:
# http://ogden.basic-english.org
import os
path = os.path.join(os.path.dirname(__file__), "ogden_2000.txt")
words = open(path).readlines()
... | Python |
# VERB - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# The verb.txt morphology was adopted from the XTAG morph_englis.flat:
# http://www.cis.upenn.edu/~xtag/
# Each verb and its tenses is a list,
# indexed according to the following keys:
verb_tenses_k... | Python |
# Module wordnet.py
#
# Original author: Oliver Steele <steele@osteele.com>
# Project Page: http://sourceforge.net/projects/pywordnet
#
# Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under
# the Artistic License
# <http://www.opensource.org/licenses/artistic-license.html>
"""Utility functions to use wit... | Python |
# Module wordnet.py
#
# Original author: Oliver Steele <steele@osteele.com>
# Project Page: http://sourceforge.net/projects/pywordnet
#
# Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under
# the Artistic License
# <http://www.opensource.org/licenses/artistic-license.html>
"""An OO interface to the WordN... | Python |
from distutils.core import setup
setup(name="pywordnet",
version="2.0.1",
description="An interface to the WordNet database.",
author="Oliver Steele",
author_email="steele@osteele.com",
url="http://pywordnet.sourceforge.net",
py_modules=["wordnet", "wntools", "concordance"],
... | Python |
# coding: utf-8
# WORDNET - last updated for NodeBox 1.9.2
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# Copyright (c) 2007 Tom De Smedt.
# See LICENSE.txt for details.
# All other files are from PyWordNet by Oliver Steele and WordNet 2:
# http://osteele.com/projects/pywordnet/
# http://wordnet.princeton.edu
#T... | Python |
#!/usr/bin/env python2.4
#
# A Test Driver for Doctest
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
#
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
"""
A driver for testing interactive python examples in text files and
docstrings. This doctest driver performs three functions:
... | Python |
#!/usr/bin/env python2.4
#
# A Test Driver for Doctest
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
#
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
"""
A driver for testing interactive python examples in text files and
docstrings. This doctest driver performs three functions:
... | Python |
# Natural Language Toolkit: Unit Tests
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: __init__.py 3289 2006-06-02 13:32:13Z stevenbird $
"""
Unit tests for the NLTK modules. ... | Python |
# Natural Language Toolkit: A Chart Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# Jean Mark Gawron <gawron@mail.sdsu.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TX... | Python |
# Natural Language Toolkit: Recursive Descent Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.parse import... | Python |
# Natural Language Toolkit: Probabilistic Context Free Grammars
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@ldc.upenn.edu> (minor additions)
# Nathan Bodenstab <bodenstab@cslu.ogi.edu> (induction)
# URL: <http://nltk.sf.ne... | Python |
# Natural Language Toolkit: Tree Transformations
#
# Copyright (C) 2005-2006 Oregon Graduate Institute
# Author: Nathan Bodenstab <bodenstab@cslu.ogi.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A collection of methods for tree (grammar) transformations used
in parsing natural langua... | Python |
# Natural Language Toolkit: Chart Parser for Feature-Based Grammars
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Rob Speer <rspeer@mit.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: featurechart.py 3587 2006-10-20 06:13:32Z ehk $
"""
Extension of chart parsing ... | Python |
# Natural Language Toolkit: Probabilistic Chart Parsers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for ass... | Python |
# Natural Language Toolkit: Reader for Grammar Files
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Rob Speer <rspeer@mit.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: grammarfile.py 3588 2006-10-20 06:13:57Z ehk $
"""
A module to read a grammar from a *.cfg fil... | Python |
from en.parser.nltk_lite.parse import cfg
def generate(grammar, start=None):
if not start:
start = grammar.start()
return _generate_all(grammar, [start])[0]
def _generate_all(grammar, items):
frags = []
if len(items) == 1:
if isinstance(items[0], cfg.Nonterminal):
for prod ... | Python |
# Natural Language Toolkit: Viterbi Probabilistic Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.parse im... | Python |
# Natural Language Toolkit: Context Free Grammars
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
"""
Basic data classes for representing context... | Python |
# Natural Language Toolkit: Feature Structures
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>,
# Steven Bird <sb@csse.unimelb.edu.au>
# Rob Speer (original code)
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TX... | Python |
# Natural Language Toolkit: A Chunk Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for identifying non-... | Python |
# Natural Language Toolkit: Categories
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Contributed by Rob Speer (NLTK version)
# Steven Bird <sb@csse.unimelb.edu.au> (NLTK-Lite Port)
# Ewan Klein <ewan@inf.ed.ac.uk> (Hooks for semantics)
# Peter Wang <wangp@csse.unimelb.edu.au> ... | Python |
# Natural Language Toolkit: Parsers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
"""
Classes and interfaces for producing tree struct... | Python |
# Natural Language Toolkit: Text Trees
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Class for representing hierarchical language st... | Python |
# Natural Language Toolkit: Shift-Reduce Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from tree import *
from en.parser.nltk_lit... | Python |
# Natural Language Toolkit: Chart Parser Demo
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Jean Mark Gawron <gawron@mail.sdsu.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE... | Python |
# Natural Language Toolkit: Dispersion Plots
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A utility for displaying lexical dispersion.
"""
from Tkinter import Canvas
def plot(text, word... | Python |
# Natural Language Toolkit: Shift/Reduce Parser Demo
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: srparser.py 3460 2006-10-06 10:39:03Z stevenbird $
"""
A graphical tool for... | Python |
# Natural Language Toolkit: Simple Plotting
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: plot.py 3460 2006-10-06 10:39:03Z stevenbird $
"""
A simple tool for plotting functi... | Python |
# Natural Language Toolkit: CFG visualization
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: cfg.py 3460 2006-10-06 10:39:03Z stevenbird $
"""
Visualization tools for CFGs.
"... | Python |
# Natural Language Toolkit: Recursive Descent Parser Demo
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: rdparser.py 3460 2006-10-06 10:39:03Z stevenbird $
"""
A graphical too... | Python |
# Natural Language Toolkit: graphical representations package
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: __init__.py 3461 2006-10-07 01:11:53Z edloper $
"""
Tools for grap... | Python |
# Natural Language Toolkit: Graphical Representations for Trees
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: tree.py 3667 2006-11-02 23:28:44Z stevenbird $
"""
Graphically d... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002 Vivake Gupta (vivakeATomniscia.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or ... | Python |
# Natural Language Toolkit: Stemmers
#
# Copyright (C) 2001-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parse... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002 Vivake Gupta (vivakeATomniscia.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or ... | Python |
# Natural Language Toolkit: Stemmers
#
# Copyright (C) 2001-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Interface... | Python |
# Natural Language Toolkit: Utility functions
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
##########################################################################
# PRETTY PRINTING
######... | Python |
# Module wordnet.py
#
# Original author: Oliver Steele <steele@osteele.com>
# Project Page: http://sourceforge.net/projects/pywordnet
#
# Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under
# the Artistic License
# <http://www.opensource.org/licenses/artistic-license.html>
"""Utility functions to use wit... | Python |
# Module wordnet.py
#
# Original author: Oliver Steele <steele@osteele.com>
# Project Page: http://sourceforge.net/projects/pywordnet
#
# Copyright (c) 1998-2004 by Oliver Steele. Use is permitted under
# the Artistic License
# <http://www.opensource.org/licenses/artistic-license.html>
"""An OO interface to the WordN... | Python |
# Natural Language Toolkit: Eliza
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Based on an Eliza implementation by Joe Strout <joe@... | Python |
# Natural Language Toolkit: Zen Chatbot
#
# Copyright (C) 2005-2006 University of Melbourne
# Author: Peter Spiller <pspiller@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from re import *
from en.parser.nltk_lite.chat import *
pairs = (
(r'We (.*)',
("What do... | Python |
# Natural Language Toolkit: Zen Chatbot
#
# Copyright (C) 2005-2006 University of Melbourne
# Author: Amy Holland <amyrh@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Zen Chatbot talks in gems of Zen wisdom.
This is a sample conversation with Zen Chatbot:
ZC: Welco... | Python |
# Natural Language Toolkit: Chatbots
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Based on an Eliza implementation by Joe Strout <joe@strout.net>,
# Jeff Epler <jepler@inetnebr.com> and Je... | Python |
# Natural Language Toolkit: Teen Chatbot
#
# Copyright (C) 2005-2006 University of Melbourne
# Author: Selina Dennis <sjmd@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This chatbot is a tongue-in-cheek take on the average teen
anime junky that frequents YahooMessenger... | Python |
# Natural Language Toolkit: Evaluation
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Utility functions for evaluating processing mo... | Python |
# Natural Language Toolkit: Semantic Interpretation
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Utility functions for batch-processing sentences: parsing and
extraction of the semantic representation of the root node of the the
syntax tree, foll... | Python |
# Natural Language Toolkit: Models for first-order languages with lambda
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>,
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
#
# $Id: evaluate.py 3581 2006-10-20 04:37:34Z ehk $
"""
Overview
========
This module provides data structures for repre... | Python |
# Natural Language Toolkit: Logic
#
# Based on church.py, Version 1.0
# Available from http://www.alcyone.com/pyos/church/
# Copyright (C) 2001-2002 Erik Max Francis
# Author: Erik Max Francis <max@alcyone.com>
#
# Modifications by: Steven Bird <sb@csse.unimelb.edu.au>
# Peter Wang
# ... | Python |
# Natural Language Toolkit: Semantic Interpretation
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This package contains classes for representing semantic structure in
formulas of first-order logic and for evaluating such formulas in
set-theoretic ... | Python |
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (additions)
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# URL: <http://nltk.sf.net>
# For licens... | Python |
# Natural Language Toolkit: N-Gram Taggers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces fo... | Python |
# Natural Language Toolkit: Hidden Markov Model
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Trevor Cohn <tacohn@csse.unimelb.edu.au>
# Philip Blunsom <pcbl@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: hmm.py 3672 2006-11-07 16:27:02Z s... | Python |
# Natural Language Toolkit: Unigram Taggers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces f... | Python |
# Natural Language Toolkit: Brill Tagger
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Christopher Maloof <cjmaloof@gradient.cis.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, ... | Python |
# Natural Language Toolkit: Taggers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for taggi... | Python |
# Natural Language Toolkit: K-Means Clusterer
#
# Copyright (C) 2004-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.cluster import *
class KMeans(Vec... | Python |
# Natural Language Toolkit: Group Average Agglomerative Clusterer
#
# Copyright (C) 2004-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.cluster import... | Python |
# Natural Language Toolkit: Expectation Maximization Clusterer
#
# Copyright (C) 2004-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.cluster import *
... | Python |
# Natural Language Toolkit: Clusterers
#
# Copyright (C) 2004-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module contains a number of basic clustering algorithms. ... | Python |
#!/usr/local/bin/python
#
# Distutils setup script for the Natural Language Toolkit
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from d... | Python |
#
# ElementTree
# $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | Python |
#
# ElementTree
# $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights re... | Python |
#
# ElementTree
# $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $
#
# light-weight XML support for Python 1.5.2 and later.
#
# history:
# 2001-10-20 fl created (from various sources)
# 2001-11-01 fl return root from parse method
# 2002-02-16 fl sort attributes in lexical order
# 2002-04-06 fl TreeBuilde... | Python |
# $Id: __init__.py 1821 2004-06-03 16:57:49Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2004 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | Python |
#!/usr/local/bin/python
#
# Distutils setup script for the Natural Language Toolkit
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from d... | Python |
# Natural Language Toolkit: Language Models
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
class ModelI(object):
"""
A processing interface for assigning a probability to the next word.... | Python |
# Marshaling code, contributed by Tiago Tresoldi
# This saves/loads models to/from plain text files.
# Unlike Python's shelve and pickle utilities,
# this is useful for inspecting or tweaking the models.
# We may incorporate this as a marshal method in each model.
# TODO: describe each tagger marshal format in the epy... | Python |
# Natural Language Toolkit: Paradigm Visualisation
#
# Copyright (C) 2005 University of Melbourne
# Author: Will Hardy
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Parses a paradigm query and produces an XML representation of
# that query. This is part of a Python implementation of David
# ... | Python |
# Natural Language Toolkit: Finite State Automata
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
FSA class - deliberately simple so that the operations are easily understood.
Operations are based... | Python |
from grammarfile import GrammarFile
from featurechart import *
from en.parser.nltk_lite import tokenize
"""
An interactive interface to the feature-based parser. Run "featuredemo.py -h" for
command-line options.
This interface will read a grammar from a *.cfg file, in the format of
test.cfg. It will prompt for a file... | Python |
# Natural Language Toolkit: Shoebox Lexicon
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Stuart Robinson <stuart@zapata.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This modules provides functionality for parsing and manipulating the
contents of a Shoebox lexicon ... | Python |
# Natural Language Toolkit: Shoebox Utilities
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Stuart Robinson <stuart@zapata.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module provides basic functionality for handling shoebox format files.
These feed into the m... | Python |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox data file parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""module for reading Toolbox data files
"""
from... | Python |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox data file parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""module for reading Toolbox data files
"""
from... | Python |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox Settings Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>/Stuart Robinson <stuart@zapata.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module... | Python |
# Natural Language Toolkit: Shoebox Errors
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Stuart Robinson <Stuart.Robinson@mpi.nl>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module provides Shoebox exceptions.
"""
# -----------------------------------------------... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.