mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-08 18:52:50 -06:00
Merge branch 'majestic' of github.com:GrammaticalFramework/gf-core into majestic
This commit is contained in:
@@ -1559,8 +1559,8 @@ void PgfDB::commit(object o)
|
||||
object save_free_descriptors = ms->free_descriptors;
|
||||
object save_active_revision = ms->active_revision;
|
||||
|
||||
int res;
|
||||
#ifndef _WIN32
|
||||
int res;
|
||||
#ifndef MREMAP_MAYMOVE
|
||||
if (fd < 0) {
|
||||
ms->active_revision = o;
|
||||
|
||||
@@ -989,4 +989,4 @@ PgfExpr PgfParser::fetch(PgfDB *db, prob_t *prob)
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ pgf_graphviz_word_alignment(PgfDB *db, PgfConcrRevision* revisions, size_t n_rev
|
||||
|
||||
typedef struct {
|
||||
PgfText *phrase;
|
||||
int n_fids;
|
||||
size_t n_fids;
|
||||
int fids[];
|
||||
} PgfAlignmentPhrase;
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ bool probspace_random(PgfProbspace space, PgfText *cat,
|
||||
|
||||
bool is_res = space->value.is_result();
|
||||
if (is_res && !st->excluded.count(space->value.fun)) {
|
||||
st->rand -= exp(-space->value.fun->prob);
|
||||
st->rand -= expf(-space->value.fun->prob);
|
||||
st->result = space->value.fun;
|
||||
if (st->rand <= 0)
|
||||
return true;
|
||||
|
||||
@@ -79,7 +79,7 @@ prob_t PgfReader::read_prob(PgfText *name)
|
||||
if (probs_callback != NULL) {
|
||||
d = probs_callback->fn(probs_callback, name);
|
||||
}
|
||||
return - log(d);
|
||||
return - logf(d);
|
||||
}
|
||||
|
||||
uint64_t PgfReader::read_uint()
|
||||
@@ -458,7 +458,7 @@ void PgfReader::read_abstract(ref<PgfAbstr> abstract)
|
||||
|
||||
for (size_t i = 0; i < itor.cats->len; i++) {
|
||||
PgfAbsCatCounts *counts = &itor.cats->data[i];
|
||||
counts->prob = - log((1-counts->probs_sum) / counts->n_nan_probs);
|
||||
counts->prob = - logf((1-counts->probs_sum) / counts->n_nan_probs);
|
||||
}
|
||||
|
||||
itor.fn = pad_probs;
|
||||
|
||||
Reference in New Issue
Block a user