Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
keeleliin-wrapper
Commits
7ae1bf86
Commit
7ae1bf86
authored
Jul 31, 2015
by
priit
Browse files
Logimise parendamine
parent
c9d5bb69
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/service/daoService.js
View file @
7ae1bf86
...
...
@@ -5,7 +5,7 @@ var config = require(__base + 'config');
var
DaoService
=
function
(){
var
self
=
this
;
var
prefix
=
config
.
wrapper
.
port
+
'
:
'
;
var
prefix
=
config
.
wrapper
.
id
+
'
:
'
;
this
.
client
=
redis
.
createClient
(
config
.
redis
.
port
,
config
.
redis
.
host
,
{});
...
...
src/util/file.js
View file @
7ae1bf86
...
...
@@ -43,6 +43,15 @@ var FileUtil = {
rmdir
:
function
(
path
,
callback
){
return
rimraf
(
path
,
callback
);
},
getExtension
:
function
(
filename
)
{
var
dotIndex
=
filename
.
lastIndexOf
(
'
.
'
);
if
(
dotIndex
>
-
1
){
return
filename
.
substr
(
filename
.
lastIndexOf
(
'
.
'
)
+
1
);
}
return
null
;
}
};
...
...
wrapper/simpleLocalCommand.js
View file @
7ae1bf86
...
...
@@ -6,6 +6,7 @@ var CommandModel = require('../src/mapper/commandModel');
var
fs
=
require
(
'
fs
'
);
var
mime
=
require
(
'
mime
'
);
var
path
=
require
(
'
path
'
);
var
FileUtil
=
require
(
'
./../src/util/file
'
);
function
SimpleLocalCommand
(){
...
...
@@ -29,7 +30,7 @@ function SimpleLocalCommand(){
session
.
addOutputFile
(
'
output
'
,
{
type
:
'
output
'
,
fileName
:
path
.
basename
(
response
.
stdOutPath
),
fileName
:
config
.
wrapper
.
id
+
'
_output.
'
+
FileUtil
.
getExtension
(
response
.
stdOutPath
),
filePath
:
response
.
stdOutPath
,
contentType
:
mime
.
lookup
(
response
.
stdOutPath
)
});
...
...
wrapper/tokenizer.js
View file @
7ae1bf86
...
...
@@ -8,6 +8,7 @@ var CommandModel = require('../src/mapper/commandModel');
var
fs
=
require
(
'
fs
'
);
var
mime
=
require
(
'
mime
'
);
var
path
=
require
(
'
path
'
);
var
FileUtil
=
require
(
'
./../src/util/file
'
);
function
Tokenizer
(){
...
...
@@ -72,7 +73,7 @@ function Tokenizer(){
session
.
addOutputFile
(
'
output
'
,
{
type
:
'
output
'
,
fileName
:
path
.
basename
(
model
.
outputPaths
.
outputPath1
),
fileName
:
config
.
wrapper
.
id
+
'
_output.
'
+
FileUtil
.
getExtension
(
model
.
outputPaths
.
outputPath1
),
filePath
:
model
.
outputPaths
.
outputPath1
,
contentType
:
mime
.
lookup
(
model
.
outputPaths
.
outputPath1
)
});
...
...
@@ -80,20 +81,16 @@ function Tokenizer(){
SessionService
.
storeToFile
(
session
.
id
,
mapping
,
{
extension
:
'
txt
'
},
function
(
error
,
mappingPath
)
{
session
.
addOutputFile
(
'
mapping
'
,
{
type
:
'
mapping
'
,
fileName
:
path
.
basename
(
mappingPath
),
fileName
:
config
.
wrapper
.
id
+
'
_mapping.
'
+
FileUtil
.
getExtension
(
mappingPath
),
filePath
:
mappingPath
,
contentType
:
mime
.
lookup
(
mappingPath
)
});
return
callback
(
error
,
session
);
});
});
});
});
});
};
...
...
wrapper_configs/global.js
View file @
7ae1bf86
...
...
@@ -165,6 +165,7 @@ config.availableWappers = {
LAUSESTAJA
:
{
title
:
'
Lausestaja
'
,
id
:
'
lau
'
,
port
:
3001
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
LAUSESTAJA
,
...
...
@@ -172,6 +173,7 @@ config.availableWappers = {
},
MORFANALYSAATOR
:
{
title
:
'
Morfoloogiline analüüs
'
,
id
:
'
moa
'
,
port
:
3002
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
MORFANALYSAATOR
,
...
...
@@ -179,6 +181,7 @@ config.availableWappers = {
},
OSALAUSESTAJA
:
{
title
:
'
Osalausestaja
'
,
id
:
'
osl
'
,
port
:
3003
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
OSALAUSESTAJA
,
...
...
@@ -186,6 +189,7 @@ config.availableWappers = {
},
MORFYHESTAJA
:
{
title
:
'
Morfoloogiline ühestamine (kitsenduste grammatika)
'
,
id
:
'
moy
'
,
port
:
3004
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
MORFYHESTAJA
,
...
...
@@ -193,6 +197,7 @@ config.availableWappers = {
},
PIND_SYN
:
{
title
:
'
Pindsüntaktiline analüüs
'
,
id
:
'
pia
'
,
port
:
3005
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
PIND_SYN
,
...
...
@@ -200,21 +205,23 @@ config.availableWappers = {
},
S6LT_SYN
:
{
title
:
'
Sõltuvussüntaktiline analüüs (ja järeltöötlus)
'
,
id
:
'
s6a
'
,
port
:
3006
,
class
:
'
simpleLocalCommand
'
,
command
:
config
.
availableCommands
.
S6LT_SYN
,
requestConf
:
simpleCommandRequest
},
ARCHIVE_EXTRACTOR
:
{
title
:
'
Arhiivi lahtipakkija
'
,
id
:
'
uzip
'
,
port
:
3007
,
class
:
'
archiveExtractor
'
,
requestConf
:
simpleCommandRequest
},
TOKENIZER
:
{
title
:
'
Sõnestaja
'
,
id
:
'
s6n
'
,
port
:
3008
,
class
:
'
tokenizer
'
,
command
:
config
.
availableCommands
.
TOKENIZER
,
...
...
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