Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
7c2a65da
Commit
7c2a65da
authored
Aug 16, 2014
by
Steven Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleted stale examples package
parent
173f3292
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
49 deletions
+0
-49
nltk/examples/__init__.py
+0
-0
nltk/examples/pt.py
+0
-49
No files found.
nltk/examples/__init__.py
deleted
100644 → 0
View file @
173f3292
nltk/examples/pt.py
deleted
100644 → 0
View file @
173f3292
# -*- coding: iso-8859-1 -*-
# Natural Language Toolkit: Some Portuguese texts for exploration in chapter 1 of the book
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from
__future__
import
print_function
,
unicode_literals
from
nltk.corpus
import
machado
,
mac_morpho
,
floresta
,
genesis
from
nltk.text
import
Text
from
nltk.probability
import
FreqDist
from
nltk.util
import
bigrams
from
nltk.misc
import
babelize_shell
print
(
"*** Introductory Examples for the NLTK Book ***"
)
print
(
"Loading ptext1, ... and psent1, ..."
)
print
(
"Type the name of the text or sentence to view it."
)
print
(
"Type: 'texts()' or 'sents()' to list the materials."
)
ptext1
=
Text
(
machado
.
words
(
'romance/marm05.txt'
),
name
=
"Memrias Pstumas de Brs Cubas (1881)"
)
print
(
"ptext1:"
,
ptext1
.
name
)
ptext2
=
Text
(
machado
.
words
(
'romance/marm08.txt'
),
name
=
"Dom Casmurro (1899)"
)
print
(
"ptext2:"
,
ptext2
.
name
)
ptext3
=
Text
(
genesis
.
words
(
'portuguese.txt'
),
name
=
"Gnesis"
)
print
(
"ptext3:"
,
ptext3
.
name
)
ptext4
=
Text
(
mac_morpho
.
words
(
'mu94se01.txt'
),
name
=
"Folha de Sao Paulo (1994)"
)
print
(
"ptext4:"
,
ptext4
.
name
)
def
texts
():
print
(
"ptext1:"
,
ptext1
.
name
)
print
(
"ptext2:"
,
ptext2
.
name
)
print
(
"ptext3:"
,
ptext3
.
name
)
print
(
"ptext4:"
,
ptext4
.
name
)
psent1
=
"o amor da glria era a coisa mais verdadeiramente humana que h no homem , e , conseqentemente , a sua mais genuna feio ."
.
split
()
psent2
=
"No consultes dicionrios ."
.
split
()
psent3
=
"No princpio, criou Deus os cus e a terra."
.
split
()
psent4
=
"A Critas acredita que outros cubanos devem chegar ao Brasil ."
.
split
()
def
sents
():
print
(
"psent1:"
,
" "
.
join
(
psent1
))
print
(
"psent2:"
,
" "
.
join
(
psent2
))
print
(
"psent3:"
,
" "
.
join
(
psent3
))
print
(
"psent4:"
,
" "
.
join
(
psent4
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment