Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
5fc7c2d7
Commit
5fc7c2d7
authored
Nov 16, 2014
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CODE] The API is now wrapped in a controller.
NgramsCache: ngrams are now stored in lowercase
parent
281e712a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
131 additions
and
130 deletions
+131
-130
api.py
gargantext_web/api.py
+127
-127
urls.py
gargantext_web/urls.py
+3
-3
Caches.py
parsing/Caches.py
+1
-0
No files found.
gargantext_web/api.py
View file @
5fc7c2d7
This diff is collapsed.
Click to expand it.
gargantext_web/urls.py
View file @
5fc7c2d7
...
...
@@ -40,9 +40,9 @@ urlpatterns = patterns('',
url
(
r'^chart/corpus/(\d+)/data.csv$'
,
send_csv
),
url
(
r'^graph.json$'
,
send_graph
),
url
(
r'^api/corpus/(\d+)/ngrams$'
,
gargantext_web
.
api
.
corpus_
ngrams
),
url
(
r'^api/corpus/(\d+)/metadata$'
,
gargantext_web
.
api
.
corpus_
metadata
),
url
(
r'^api/corpus/(\d+)/data$'
,
gargantext_web
.
api
.
corpus_
data
),
url
(
r'^api/corpus/(\d+)/ngrams$'
,
gargantext_web
.
api
.
CorpusController
.
ngrams
),
url
(
r'^api/corpus/(\d+)/metadata$'
,
gargantext_web
.
api
.
CorpusController
.
metadata
),
url
(
r'^api/corpus/(\d+)/data$'
,
gargantext_web
.
api
.
CorpusController
.
data
),
)
from
django.conf
import
settings
...
...
parsing/Caches.py
View file @
5fc7c2d7
...
...
@@ -16,6 +16,7 @@ class NgramsCache(defaultdict):
def
__missing__
(
self
,
terms
):
"""If the terms are not yet present in the dictionary,
retrieve it from the database or insert it."""
terms
=
terms
.
strip
()
.
lower
()
try
:
ngram
=
node
.
models
.
Ngram
.
get
(
terms
=
terms
,
language
=
self
.
language
)
except
:
...
...
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