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
24e78d17
Commit
24e78d17
authored
Feb 19, 2015
by
Avital Pekker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Trivial cleanup
parent
c7f1f197
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
nltk/corpus/reader/crubadan.py
+2
-3
No files found.
nltk/corpus/reader/crubadan.py
View file @
24e78d17
...
@@ -23,7 +23,6 @@ http://borel.slu.edu/crubadan/index.html
...
@@ -23,7 +23,6 @@ http://borel.slu.edu/crubadan/index.html
from
__future__
import
print_function
,
unicode_literals
from
__future__
import
print_function
,
unicode_literals
from
nltk.corpus.reader
import
CorpusReader
from
nltk.corpus.reader
import
CorpusReader
from
nltk.corpus.util
import
LazyCorpusLoader
from
nltk.probability
import
FreqDist
from
nltk.probability
import
FreqDist
from
nltk.data
import
ZipFilePathPointer
from
nltk.data
import
ZipFilePathPointer
...
@@ -60,7 +59,7 @@ class CrubadanCorpusReader(CorpusReader):
...
@@ -60,7 +59,7 @@ class CrubadanCorpusReader(CorpusReader):
''' Return n-gram frequency as integer given
''' Return n-gram frequency as integer given
an ISO 639-3 language code and n-gram '''
an ISO 639-3 language code and n-gram '''
if
lang
not
in
self
.
all_lang_freq
:
if
lang
not
in
self
.
all_lang_freq
:
raise
CrubadanError
(
"Unsupp
ro
ted language ["
+
lang
+
"]."
)
raise
CrubadanError
(
"Unsupp
or
ted language ["
+
lang
+
"]."
)
lf
=
self
.
all_lang_freq
[
lang
]
lf
=
self
.
all_lang_freq
[
lang
]
return
lf
[
ngram
]
return
lf
[
ngram
]
...
@@ -77,7 +76,7 @@ class CrubadanCorpusReader(CorpusReader):
...
@@ -77,7 +76,7 @@ class CrubadanCorpusReader(CorpusReader):
''' Return internal Crubadan code based on ISO 639-3 code '''
''' Return internal Crubadan code based on ISO 639-3 code '''
for
i
in
self
.
_lang_mapping_data
:
for
i
in
self
.
_lang_mapping_data
:
if
i
[
1
]
.
lower
()
==
lang
.
lower
():
if
i
[
1
]
.
lower
()
==
lang
.
lower
():
return
(
i
[
0
])
return
unicode
(
i
[
0
])
def
crubadan_to_iso
(
self
,
lang
):
def
crubadan_to_iso
(
self
,
lang
):
''' Return ISO 639-3 code given internal Crubadan code '''
''' Return ISO 639-3 code given internal Crubadan code '''
...
...
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