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
03db9686
Commit
03db9686
authored
Dec 04, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel' into unstable
parents
8117fc8d
40723a01
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
47 deletions
+80
-47
corpus_views.py
gargantext_web/corpus_views.py
+19
-12
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+1
-1
Journals_dyna_chart_and_table.js
static/js/Journals_dyna_chart_and_table.js
+1
-0
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+43
-23
terms.html
templates/corpus/terms.html
+3
-3
views.py
tests/ngramstable/views.py
+13
-8
No files found.
gargantext_web/corpus_views.py
View file @
03db9686
...
...
@@ -73,11 +73,14 @@ def test_page(request , project_id , corpus_id):
corpus
=
cache
.
Node
[
int
(
corpus_id
)]
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -115,11 +118,13 @@ def get_ngrams(request , project_id , corpus_id ):
list_id
=
listIds
(
user_id
=
request
.
user
.
id
,
corpus_id
=
int
(
corpus_id
),
typeList
=
list_type
)
lists
[
"
%
s"
%
list_id
[
0
][
0
]]
=
list_type
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -183,11 +188,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
static/js/Docs_dyna_chart_and_table.js
View file @
03db9686
...
...
@@ -524,7 +524,7 @@ function SearchFilters( elem ) {
$
.
ajax
({
url
:
'/tests/paginator/corpus/'
+
url_mainIDs
[
"corpus"
],
success
:
function
(
data
){
$
(
"#content_loader"
).
remove
()
for
(
var
i
in
data
.
records
)
{
var
orig_id
=
parseInt
(
data
.
records
[
i
].
id
)
var
arr_id
=
parseInt
(
i
)
...
...
static/js/Journals_dyna_chart_and_table.js
View file @
03db9686
...
...
@@ -502,6 +502,7 @@ $.ajax({
console
.
log
(
data
)
$
(
"#content_loader"
).
remove
()
// // Initializing the Charts and Table
var
result
=
Main_test
(
data
,
"FirstScore"
)
console
.
log
(
result
)
...
...
static/js/NGrams_dyna_chart_and_table.js
View file @
03db9686
...
...
@@ -164,6 +164,7 @@ function GetUserPortfolio() {
}
});
}
function
printCorpuses
()
{
console
.
log
(
"!!!!!!!! in printCorpuses() !!!!!!!! "
)
pr
(
corpusesList
)
...
...
@@ -181,33 +182,53 @@ function printCorpuses() {
$
(
"#closecorpuses"
).
click
();
// EXTERNAL CORPUS TO COMPARE:
var
whichlist
=
$
(
'input[name=whichlist]:checked'
).
val
()
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
+
"?custom"
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
//
+"?custom"
console
.
log
(
url
)
GET_
(
url
,
function
(
results
)
{
if
(
Object
.
keys
(
results
).
length
>
0
)
{
var
sub_ngrams_data
=
{
"ngrams"
:[],
"scores"
:
$
.
extend
({},
NGrams
[
"main"
].
scores
)
}
if
(
whichlist
==
"stop"
)
{
for
(
var
r
in
results
)
{
var
a_ngram
=
results
[
r
]
a_ngram
[
"state"
]
=
System
[
0
][
"statesD"
][
"delete"
]
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
if
(
results
[
NGrams
[
"main"
].
ngrams
[
i
].
id
]
)
{
var
a_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
sub_ngrams_data
[
"ngrams"
].
push
(
a_ngram
)
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_stop-list"
)
}
if
(
whichlist
==
"miam"
)
{
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
var
local_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
console
.
log
(
local_ngram
)
// if( results[ NGrams["main"].ngrams[i].id] && NGrams["main"].ngrams[i].name.split(" ").length==1 ) {
// if( NGrams["map"][ NGrams["main"].ngrams[i].id] ) {
// var a_ngram = NGrams["main"].ngrams[i]
// // a_ngram["state"] = System[0]["statesD"]["delete"]
// sub_ngrams_data["ngrams"].push( a_ngram )
// }
// }
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_all"
)
}
// var sub_ngrams_data = {
// "ngrams":[],
// "scores": $.extend({}, NGrams["main"].scores)
// }
// if(whichlist=="stop") {
// for(var r in results) {
// var a_ngram = results[r]
// a_ngram["state"] = System[0]["statesD"]["delete"]
// sub_ngrams_data["ngrams"].push( a_ngram )
// }
// var result = Main_test(sub_ngrams_data , NGrams["main"].scores.initial , "filter_stop-list")
// }
// if(whichlist=="miam") {
// for(var i in NGrams["main"].ngrams) {
// var local_ngram = NGrams["main"].ngrams[i]
// console.log( local_ngram )
// }
// var result = Main_test(sub_ngrams_data , NGrams["main"].scores.initial , "filter_all")
// }
}
});
...
...
@@ -928,7 +949,6 @@ function Main_test( data , initial , search_filter) {
}
function
SearchFilters
(
elem
)
{
var
MODE
=
elem
.
value
;
...
...
templates/corpus/terms.html
View file @
03db9686
...
...
@@ -222,7 +222,7 @@ input[type=radio]:checked + label {
<label
class=
"control-label"
>
Which list do you want?
</label>
<label
class=
"radio"
>
<input
value=
"miam"
name=
"whichlist"
disabled
type=
"radio"
>
MiamList
<input
value=
"miam"
name=
"whichlist"
type=
"radio"
>
MiamList
</label>
<label
class=
"radio"
>
<input
value=
"stop"
name=
"whichlist"
checked
type=
"radio"
>
StopList
...
...
@@ -264,9 +264,9 @@ input[type=radio]:checked + label {
<option
id=
"filter_stop-list"
value=
"filter_stop-list"
>
Stop-List
</option>
<!-- </optgroup> -->
</select>
<!--
<button
id=
"ImportList"
onclick=
"GetUserPortfolio(); $('#corpuses').modal('show');"
class=
"btn btn-warning"
>
Import a Corpus-List
</button>
-->
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
...
...
tests/ngramstable/views.py
View file @
03db9686
...
...
@@ -77,11 +77,14 @@ def get_ngrams(request , project_id , corpus_id ):
myamlist_type_id
=
cache
.
NodeType
[
'MiamList'
]
.
id
miamlist
=
session
.
query
(
Node
)
.
filter
(
Node
.
user_id
==
request
.
user
.
id
,
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
myamlist_type_id
)
.
first
()
t
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -116,11 +119,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
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