OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-link-grammar commits / 4f27bc4

Fix build break due to obsolete AtomSpace usage.
4f27bc4ce72d1b351da626ee477cd3621847f90e
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-25T17:56:01.000Z

Changed files (2) +10 -8

ChangeLog +2 -2
……@@ -1,5 +1,5 @@
1Version 5.12.7 (XXX 2025)
2 * (Nothing yet.)
1Version 5.12.7 (25 September 2025)
2 * Fix build break due to obsolete AtomSpace API usage.
33
44Version 5.12.6 (29 August 2025)
55 * Fix build break due to missing header file.
link-grammar/dict-atomese/link-names.cc +8 -6
……@@ -9,7 +9,7 @@
99
1010#include <cmath>
1111#include <cstdlib>
12#include <opencog/atoms/truthvalue/CountTruthValue.h>
12#include <opencog/atoms/value/FloatValue.h>
1313#include <opencog/atomspace/AtomSpace.h>
1414#include <opencog/nlp/types/atom_types.h>
1515
……@@ -148,10 +148,11 @@ void fetch_link_id(Local* local)
148148 if (local->stnp)
149149 local->stnp->fetch_atom(local->idanch);
150150
151 const TruthValuePtr& tv = local->idanch->getTruthValue();
152 const CountTruthValuePtr ctv(CountTruthValueCast(tv));
151 Handle key(createNode(PREDICATE_NODE, "*-LG-last-id-*"));
152 const ValuePtr& tv = local->idanch->getValue(key);
153 const FloatValuePtr ctv(FloatValueCast(tv));
153154 if (ctv)
154 local->last_id = std::round(ctv->get_count());
155 local->last_id = std::round(ctv->value()[0]);
155156}
156157
157158// Record the last unissued id.
……@@ -159,8 +160,9 @@ void store_link_id(Local* local)
159160{
160161 if (not local->using_external_as) return;
161162
162 TruthValuePtr tvp(createCountTruthValue(1, 0, local->last_id));
163 local->asp->set_truthvalue(local->idanch, tvp);
163 Handle key(createNode(PREDICATE_NODE, "*-LG-last-id-*"));
164 ValuePtr tvp(createFloatValue(local->last_id));
165 local->asp->set_value(local->idanch, key, tvp);
164166
165167 // Store, if there is storage.
166168 if (local->stnp)