Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexis Nasr
macaon2
Commits
e9ccdd69
Commit
e9ccdd69
authored
8 years ago
by
Alexis Nasr
Browse files
Options
Downloads
Patches
Plain Diff
added an option to fplm2cff for specifying the file in which the feature dictionary will be written
parent
1b0ec83f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
maca_morpho/src/context.c
+13
-3
13 additions, 3 deletions
maca_morpho/src/context.c
maca_morpho/src/context.h
+2
-5
2 additions, 5 deletions
maca_morpho/src/context.h
maca_morpho/src/fplm2cff.c
+10
-1
10 additions, 1 deletion
maca_morpho/src/fplm2cff.c
with
25 additions
and
9 deletions
maca_morpho/src/context.c
+
13
−
3
View file @
e9ccdd69
...
...
@@ -29,6 +29,7 @@ context *context_new(void)
ctx
->
fplm_filename
=
NULL
;
ctx
->
language
=
strdup
(
"fr"
);
ctx
->
maca_data_path
=
NULL
;
ctx
->
features_filename
=
NULL
;
return
ctx
;
}
...
...
@@ -48,6 +49,7 @@ void context_fplm_help_message(context *ctx){
void
context_language_help_message
(
context
*
ctx
){
fprintf
(
stderr
,
"
\t
-L --language : identifier of the language to use
\n
"
);
}
void
context_maca_data_path_help_message
(
context
*
ctx
){
fprintf
(
stderr
,
"
\t
-M --maca_data_path : path to maca_data directory
\n
"
);
}
...
...
@@ -56,6 +58,10 @@ void context_fm_help_message(context *ctx){
fprintf
(
stderr
,
"
\t
-F --fm <file> : feature model file name
\n
"
);
}
void
context_features_filename_help_message
(
context
*
ctx
){
fprintf
(
stderr
,
"
\t
-x --feat <file> : features dictionary file name
\n
"
);
}
context
*
context_read_options
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -65,7 +71,7 @@ context *context_read_options(int argc, char *argv[])
ctx
->
program_name
=
strdup
(
argv
[
0
]);
static
struct
option
long_options
[
8
]
=
static
struct
option
long_options
[
9
]
=
{
{
"help"
,
no_argument
,
0
,
'h'
},
{
"verbose"
,
no_argument
,
0
,
'v'
},
...
...
@@ -74,12 +80,13 @@ context *context_read_options(int argc, char *argv[])
{
"language"
,
required_argument
,
0
,
'L'
},
{
"fplm"
,
required_argument
,
0
,
'f'
},
{
"maca_data_path"
,
required_argument
,
0
,
'D'
},
{
"fm"
,
required_argument
,
0
,
'F'
}
{
"fm"
,
required_argument
,
0
,
'F'
},
{
"feat"
,
required_argument
,
0
,
'x'
}
};
optind
=
0
;
opterr
=
0
;
while
((
c
=
getopt_long
(
argc
,
argv
,
"hvdf:L:M:D:F:"
,
long_options
,
&
option_index
))
!=
-
1
){
while
((
c
=
getopt_long
(
argc
,
argv
,
"hvdf:L:M:D:F:
x:
"
,
long_options
,
&
option_index
))
!=
-
1
){
switch
(
c
)
{
case
'd'
:
...
...
@@ -103,6 +110,9 @@ context *context_read_options(int argc, char *argv[])
case
'F'
:
ctx
->
fm_filename
=
strdup
(
optarg
);
break
;
case
'x'
:
ctx
->
features_filename
=
strdup
(
optarg
);
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
maca_morpho/src/context.h
+
2
−
5
View file @
e9ccdd69
...
...
@@ -17,6 +17,7 @@ typedef struct {
char
*
language
;
char
*
maca_data_path
;
char
*
fm_filename
;
char
*
features_filename
;
}
context
;
...
...
@@ -26,12 +27,8 @@ void context_free(context *ctx);
context
*
context_read_options
(
int
argc
,
char
*
argv
[]);
void
context_general_help_message
(
context
*
ctx
);
void
context_conll_help_message
(
context
*
ctx
);
void
context_language_help_message
(
context
*
ctx
);
void
context_fplm_help_message
(
context
*
ctx
);
void
context_maca_data_path_help_message
(
context
*
ctx
);
void
context_mcd_help_message
(
context
*
ctx
);
void
context_form_column_help_message
(
context
*
ctx
);
void
context_pos_column_help_message
(
context
*
ctx
);
void
context_features_filename_help_message
(
context
*
ctx
);
#endif
This diff is collapsed.
Click to expand it.
maca_morpho/src/fplm2cff.c
+
10
−
1
View file @
e9ccdd69
...
...
@@ -49,6 +49,14 @@ feat_vec *form2fv(char *form, feat_vec *fv, feat_model *fm, dico *dico_features)
int
main
(
int
argc
,
char
*
argv
[])
{
context
*
ctx
=
context_read_options
(
argc
,
argv
);
if
(
ctx
->
help
){
context_general_help_message
(
ctx
);
context_language_help_message
(
ctx
);
context_fplm_help_message
(
ctx
);
context_maca_data_path_help_message
(
ctx
);
context_features_filename_help_message
(
ctx
);
exit
(
1
);
}
feat_vec
*
fv
=
feat_vec_new
(
10
);
dico
*
dico_features
=
dico_new
(
"dico_features"
,
1000
);
feat_model
*
fm
=
feat_model_read
(
ctx
->
fm_filename
,
feat_lib_build
(),
ctx
->
verbose
);
...
...
@@ -61,7 +69,8 @@ int main(int argc, char *argv[])
feat_vec_print
(
stdout
,
fv
);
}
/* dico_print_fh(stdout, dico_features); */
dico_print
(
"xx"
,
dico_features
);
if
(
ctx
->
features_filename
)
dico_print
(
ctx
->
features_filename
,
dico_features
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment