Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김지훈
/
3line
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김지훈
2016-11-12 22:42:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
64ed328e3c5367a2b5699308e820624dc770bcff
64ed328e
1 parent
ea40909b
Bug Fix : make result an array, not a string
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
Server/routes/index.js
Server/routes/index.js
View file @
64ed328
...
...
@@ -45,16 +45,16 @@ router.get('/', function(req, res, next) {
var
selectedIndex
=
ranker
.
getSelectedIndex
(
Rank
,
3
);
// 문장의 순서대로 정렬하는 게 문맥상 자연스러운 듯.
selectedIndex
.
sort
();
var
result
=
''
;
var
result
=
[]
;
for
(
var
i
=
0
;
i
<
3
;
i
++
){
for
(
var
j
=
0
;
j
<
sentences
.
length
;
j
++
){
if
(
selectedIndex
[
i
]
===
j
){
result
+=
sentences
[
j
]
+
' '
;
result
[
i
]
=
sentences
[
j
]
;
}
}
}
return
res
.
render
(
'index'
,
{
title
:
result
});
return
res
.
json
({
shorten
:
result
});
}
);
...
...
Please
register
or
login
to post a comment