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
89c594c6
Commit
89c594c6
authored
8 years ago
by
Alexis Nasr
Browse files
Options
Downloads
Patches
Plain Diff
moved parser specific code that was in feat_model.c to maca_trans_parser
parent
dc4e44ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
maca_common/src/feat_model.c
+0
-30
0 additions, 30 deletions
maca_common/src/feat_model.c
maca_trans_parser/src/config2feat_vec.c
+1
-1
1 addition, 1 deletion
maca_trans_parser/src/config2feat_vec.c
with
1 addition
and
31 deletions
maca_common/src/feat_model.c
+
0
−
30
View file @
89c594c6
...
@@ -130,36 +130,6 @@ void catenate_int(char *string, int val)
...
@@ -130,36 +130,6 @@ void catenate_int(char *string, int val)
strcat
(
string
,
s
);
strcat
(
string
,
s
);
}
}
int
feat_model_get_feat_value_fann
(
feat_model
*
fm
,
config
*
c
,
int
feat_nb
)
{
feat_desc
*
fd
=
fm
->
array
[
feat_nb
];
/* fm must be exclusively composed of simple features */
return
fd
->
array
[
0
]
->
fct
(
c
);
}
int
feat_model_get_feat_value_cff
(
feat_model
*
fm
,
config
*
c
,
dico
*
dico_features
,
int
feat_nb
,
int
mode
)
{
feat_desc
*
fd
=
fm
->
array
[
feat_nb
];
int
i
;
int
feat_val
;
/* the name of the feature is built in fm->string and its value in the dictionnary (dico_features) is returned */
fm
->
string
[
0
]
=
'\0'
;
for
(
i
=
0
;
i
<
fd
->
nbelem
;
i
++
){
strcat
(
fm
->
string
,
fd
->
array
[
i
]
->
name
);
strcat
(
fm
->
string
,
"=="
);
feat_val
=
fd
->
array
[
i
]
->
fct
(
c
);
catenate_int
(
fm
->
string
,
feat_val
);
}
if
(
mode
==
LOOKUP_MODE
){
if
(
fm
->
string
)
/* printf("fmstring = %s\n", fm->string); */
return
dico_string2int
(
dico_features
,
fm
->
string
);
}
return
dico_add
(
dico_features
,
fm
->
string
);
}
feat_model
*
feat_model_new
(
char
*
name
)
feat_model
*
feat_model_new
(
char
*
name
)
{
{
...
...
This diff is collapsed.
Click to expand it.
maca_trans_parser/src/config2feat_vec.c
+
1
−
1
View file @
89c594c6
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
#include
"feat_model.h"
#include
"feat_model.h"
#include
"config2feat_vec.h"
#include
"config2feat_vec.h"
int
get_feat_value_fann
(
feat_model
*
fm
,
config
*
c
,
int
feat_nb
)
int
get_feat_value_fann
(
feat_model
*
fm
,
config
*
c
,
int
feat_nb
)
{
{
feat_desc
*
fd
=
fm
->
array
[
feat_nb
];
feat_desc
*
fd
=
fm
->
array
[
feat_nb
];
...
@@ -23,6 +22,7 @@ int get_feat_value_cff(feat_model *fm, config *c, dico *dico_features, int feat_
...
@@ -23,6 +22,7 @@ int get_feat_value_cff(feat_model *fm, config *c, dico *dico_features, int feat_
fm
->
string
[
0
]
=
'\0'
;
fm
->
string
[
0
]
=
'\0'
;
for
(
i
=
0
;
i
<
fd
->
nbelem
;
i
++
){
for
(
i
=
0
;
i
<
fd
->
nbelem
;
i
++
){
strcat
(
fm
->
string
,
fd
->
array
[
i
]
->
name
);
strcat
(
fm
->
string
,
fd
->
array
[
i
]
->
name
);
strcat
(
fm
->
string
,
"=="
);
feat_val
=
fd
->
array
[
i
]
->
fct
(
c
);
feat_val
=
fd
->
array
[
i
]
->
fct
(
c
);
catenate_int
(
fm
->
string
,
feat_val
);
catenate_int
(
fm
->
string
,
feat_val
);
}
}
...
...
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