OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-link-grammar commits / ead2ba1

Fix typos in comments
ead2ba15b09a630307e8e77909cdbd957154bbf9
by ampli <amirpli@gmail.com> · 2024-05-31T00:09:33.000Z

Changed files (18) +30 -30

configure.ac +3 -3
……@@ -156,7 +156,7 @@ AC_SUBST(HOST_OS)
156156
157157# ====================================================================
158158# FreeBSD work-around. Apparently, the AX_PTHREAD autoconf macro
159# fails to include -lstdthreads in it's results. See bug report
159# fails to include -lstdthreads in its results. See bug report
160160# https://github.com/opencog/link-grammar/issues/1355
161161# So we hack, and explicitly set it here.
162162
……@@ -495,7 +495,7 @@ AC_SUBST(SQLITE3_CFLAGS)
495495# The AtomSpace dictionary backend
496496# TODO - use pkg_config for find the libs.
497497# TODO - do NOT specify -lpersist-rocks -lpersist-cog here,
498# they need to be dynmically loaded instead (for proper
498# they need to be dynamically loaded instead (for proper
499499# initialization of the shared library ctors these contain).
500500# Alternately, if they are found, then wrap them with
501501# "-Wl,--no-as-needed"
……@@ -930,7 +930,7 @@ fi
930930
931931# ===================================================================
932932# swig is needed for compiling the Perl and Python bindings ...
933# ... well, actually, no, its not. 'make dist' is currently set up to
933# ... well, actually, no, it's not. 'make dist' is currently set up to
934934# package all of the files generated by swig, so the user does not need
935935# to actually install it. However, swig is needed to create the package,
936936# and also needed to build from a GitHub pull.
link-grammar/api-structures.h +1 -1
……@@ -24,7 +24,7 @@
2424 *
2525 * To make the API simpler, each of these is typedef'ed as a pointer
2626 * to a data structure. If you're not used to this, some of the code
27 * may look strange, since its not plain that these types are pointers.
27 * may look strange, since it's not plain that these types are pointers.
2828 *
2929 *********************************************************************/
3030
link-grammar/dict-atomese/lookup-atomese.cc +1 -1
……@@ -644,7 +644,7 @@ void and_enchain_right(Pool_desc* pool, Exp* &andhead, Exp* &andtail, Exp* item)
644644static void report_dict_usage(Dictionary dict)
645645{
646646 // We could also print pool_num_elements_issued() but this is not
647 // interesting; its slightly less than pool_size().
647 // interesting; it's slightly less than pool_size().
648648 logger().info("LG Dict: %lu entries; %lu Exp_pool elts; %lu MiBytes",
649649 dict->num_entries,
650650 pool_size(dict->Exp_pool),
link-grammar/dict-atomese/sections.cc +1 -1
……@@ -351,7 +351,7 @@ Dict_node * lookup_section(Dictionary dict, const Handle& germ)
351351 Exp* andtail = nullptr;
352352
353353 // We really expect dn to not be null here, but ... perhaps it
354 // is, if its just not been observed before.
354 // is, if it's just not been observed before.
355355 Exp* eee = nullptr;
356356 if (dn)
357357 {
link-grammar/dict-atomese/word-pairs.cc +3 -3
……@@ -260,7 +260,7 @@ static Exp* make_pair_exprs(Dictionary dict, const Handle& germ)
260260 // Get the cached link-name for this pair.
261261 const std::string& slnk = cached_linkname(local, rawpr);
262262
263 // Direction is easy to determine: its either left or right.
263 // Direction is easy to determine: it's either left or right.
264264 char cdir = '+';
265265 if (rawpr->getOutgoingAtom(1) == germ) cdir = '-';
266266
……@@ -446,7 +446,7 @@ static Exp* make_any_conns(Dictionary dict, Pool_desc* pool)
446446/// and arity is 3, then this will return `(A+ or B- or C+ or ())
447447/// and (A+ or B- or C+ or ()) and (A+ or B- or C+ or ())`. When
448448/// this is exploded into disjuncts, any combination is possible,
449/// from size zero to three. That's why its a Cartesian product.
449/// from size zero to three. That's why it's a Cartesian product.
450450///
451451/// FYI, this is a work-around for the lack of a commmutative
452452/// multi-product. What we really want to do here is to have the
……@@ -497,7 +497,7 @@ Exp* make_cart_pairs(Dictionary dict, const Handle& germ,
497497
498498 Exp* optex = make_optional_node(pool, epr);
499499
500 // If its 1-dimensional, we are done.
500 // If it's 1-dimensional, we are done.
501501 if (1 == arity) return optex;
502502
503503 Exp* andhead = nullptr;
link-grammar/dict-common/dict-common.h +1 -1
……@@ -151,7 +151,7 @@ struct Dictionary_s
151151 /* Duplicate words are disallowed in 4.0.dict unless
152152 * allow_duplicate_words is defined to "true".
153153 * Duplicate idioms are allowed, unless the "test" parse option
154 * is set to "disalow-dup-idioms" (listing them for debug).
154 * is set to "disallow-dup-idioms" (listing them for debug).
155155 * If these variables are 0, they get their allow/disallow values
156156 * when the first duplicate word/idiom is encountered.
157157 * 0: not set; 1: allow; -1: disallow */
link-grammar/dict-common/dict-utils.c +1 -1
……@@ -36,7 +36,7 @@ void patch_subscript(char * s)
3636 if (*de == '\0') return;
3737 dp = (int) *de;
3838
39 /* If it's followed by a UTF8 char, its NOT a subscript */
39 /* If it's followed by a UTF8 char, it's NOT a subscript */
4040 if (127 < dp || dp < 0) return;
4141 /* assert ((0 < dp) && (dp <= 127), "Bad dictionary entry!"); */
4242 if (isdigit(dp)) return;
link-grammar/dict-common/idiom.c +1 -1
……@@ -223,7 +223,7 @@ void insert_idiom(Dictionary dict, Dict_node * dn)
223223
224224 /* ---- end of the code alluded to above ---- */
225225
226 /* now its time to insert them into the dictionary */
226 /* now it's time to insert them into the dictionary */
227227
228228 dn_list = start_dn_list;
229229
link-grammar/dict-ram/dict-ram.c +2 -2
……@@ -69,7 +69,7 @@ void free_dictionary_root(Dictionary dict)
6969/**
7070 * dict_order_strict - order two dictionary words in proper sort order.
7171 * Return zero if the strings match, else return in a unique order.
72 * The order is NOT (locale-dependent) UTF8 sort order; its ordered
72 * The order is NOT (locale-dependent) UTF8 sort order; it's ordered
7373 * based on numeric values of single bytes. This will uniquely order
7474 * UTF8 strings, just not in a LANG-dependent (locale-dependent) order.
7575 * But we don't need/want locale-dependent ordering!
……@@ -309,7 +309,7 @@ Dict_node * dict_node_wild_lookup(Dictionary dict, const char *s)
309309 * The in-RAM representation is NOT a binary tree; instead it is a tree
310310 * of lists. An Exp node contains a tag: `AND_type`, `OR_type`, etc.
311311 * The `operand_next` field is used to hold a linked list which is
312 * joined up with the given Exp type. This is more efficent to traverse,
312 * joined up with the given Exp type. This is more efficient to traverse,
313313 * and also saves space, as compared to an ordinary binary tree.
314314 *
315315 * Example: (A or B or C or D) becomes
link-grammar/dict-sql/read-sql.c +1 -1
……@@ -66,7 +66,7 @@ static const char * make_expression(Dictionary dict,
6666 while (*p && (lg_isspace((unsigned char)*p))) p++;
6767 if (0 == *p) return p;
6868
69 /* If it's an open paren, assume its the beginning of a new list */
69 /* If it's an open paren, assume it's the beginning of a new list */
7070 if ('(' == *p)
7171 {
7272 p = make_expression(dict, ++p, pex);
link-grammar/parse/count.c +2 -2
……@@ -66,7 +66,7 @@ struct Table_tracon_s
6666 * Each element of these arrays points to a vector, called here word-vector,
6767 * with a size equal to abs(nearest_word - farthest_word) + 1.
6868 *
69 * Each element of this vector predicts, in it's status field, whether the
69 * Each element of this vector predicts, in its status field, whether the
7070 * expected count is zero for a given null-count (when the word it
7171 * represents is the end word of the range).
7272 * This prediction is valid for null-counts up to null_count (or for any
……@@ -164,7 +164,7 @@ static size_t estimate_tracon_entries(Sentence sent)
164164}
165165
166166#if HAVE_THREADS_H && !__EMSCRIPTEN__
167/* Each thread will get it's own version of the `kept_table`.
167/* Each thread will get its own version of the `kept_table`.
168168 * If the program creates zillions of threads, then there will
169169 * be a mem-leak if this table is not released when each thread
170170 * exits. This code arranges so that `free_tls_table` is called
link-grammar/parse/extract-links.c +1 -1
……@@ -851,7 +851,7 @@ static void issue_links_for_choice(Linkage lkg, Parse_choice *pc,
851851 *
852852 * How it works:
853853 *
854 * Each linkage has the abstact form of a binary tree, with left and
854 * Each linkage has the abstract form of a binary tree, with left and
855855 * right subtrees. The Parse_set is an encoding for all possible
856856 * trees. Selecting a linkage is then a matter of selecting tree from
857857 * out of the parse-set.
link-grammar/parse/parse.c +2 -2
……@@ -354,7 +354,7 @@ static int linkage_equiv_p(Linkage lpv, Linkage lnx)
354354 // names were the same. The connector types might still differ,
355355 // due to intersection. The multi-connector flag might differ.
356356 // However, neither of these are likely. It is plausible to skip
357 // this check entirely, its mostly a CPU-time-waster that will
357 // this check entirely, it's mostly a CPU-time-waster that will
358358 // never find any differences for the almost any situation.
359359 for (uint32_t li=0; li<lpv->num_links; li++)
360360 {
……@@ -460,7 +460,7 @@ static void deduplicate_linkages(Sentence sent, int linkage_limit)
460460 !sent->overflowed && (sent->num_linkages_found <= linkage_limit)))
461461 return;
462462
463 // Deduplicate the valid linkages only; its not worth wasting
463 // Deduplicate the valid linkages only; it's not worth wasting
464464 // CPU time on the rest. Sorting guarantees that the valid
465465 // linkages come first.
466466 uint32_t nl = sent->num_valid_linkages;
link-grammar/parse/prune.c +1 -1
……@@ -44,7 +44,7 @@
4444#define PRx(x) fprintf(stderr, ""#x)
4545#define PR(...) true
4646
47/* Indicator that this connector cannot be used -- that its "obsolete". */
47/* Indicator that this connector cannot be used -- that it's "obsolete". */
4848#define BAD_WORD (MAX_SENTENCE+1)
4949
5050typedef uint8_t WordIdx_m; /* Storage representation of word index */
link-grammar/prepare/exprune.c +1 -1
……@@ -185,7 +185,7 @@ static inline bool matches_S(connector_table **ct, int w, condesc_t * c)
185185 * doesn't match anything in the set S.
186186 *
187187 * If an OR or AND type expression node has one child, we can replace it
188 * by it's child. This, of course, is not really necessary, except for
188 * by its child. This, of course, is not really necessary, except for
189189 * performance.
190190 */
191191
link-grammar/tokenize/tokenize.c +6 -6
……@@ -1444,7 +1444,7 @@ static bool mprefix_split(Sentence sent, Gword *unsplit_word, const char *word)
14441444 mprefix_list = AFCLASS(dict->affix_table, AFDICT_MPRE);
14451445 mp_strippable = mprefix_list->length;
14461446 if (0 == mp_strippable) return false;
1447 /* The mprefix list is revered-sorted according to prefix length.
1447 /* The mprefix list is reversed-sorted according to prefix length.
14481448 * The code here depends on that. */
14491449 mprefix = mprefix_list->string;
14501450
……@@ -1539,11 +1539,11 @@ static bool mprefix_split(Sentence sent, Gword *unsplit_word, const char *word)
15391539}
15401540
15411541/* Return true if the word might be capitalized by convention:
1542 * -- if its the first word of a sentence
1543 * -- if its the first word following a colon, a period, a question mark,
1542 * -- if it's the first word of a sentence
1543 * -- if it's the first word following a colon, a period, a question mark,
15441544 * or any bullet (For example: VII. Ancient Rome)
1545 * -- if its the first word following an ellipsis
1546 * -- if its the first word of a quote
1545 * -- if it's the first word following an ellipsis
1546 * -- if it's the first word of a quote
15471547 *
15481548 * XXX FIXME: These rules are rather English-centric. Someone should
15491549 * do something about this someday.
……@@ -2270,7 +2270,7 @@ static void issue_r_stripped(Sentence sent,
22702270 if (NULL != r_stripped[1][i])
22712271 {
22722272 /* We are going to issue a subscripted word which is not a
2273 * substring of it's unsplit_word. For now, the token position
2273 * substring of its unsplit_word. For now, the token position
22742274 * computation code needs an indication for that. */
22752275 replabel = strdupa(label);
22762276 replabel[0] = REPLACEMENT_MARK[0];
link-grammar/tracon-set.c +1 -1
……@@ -64,7 +64,7 @@ static tid_hash_t hash_connectors(const Connector *c, unsigned int shallow)
6464 * cache/swap trashing if the table temporary grows very big. However, it
6565 * had a bug, and it is not clear when to shrink the table - shrinking it
6666 * unnecessarily can cause an overhead of a table growth. Keep for
67 * possible reimlementation of a similar idea.
67 * possible reimplementation of a similar idea.
6868 */
6969static unsigned int find_prime_for(size_t count)
7070{
link-parser/lg_readline.c +1 -1
……@@ -49,7 +49,7 @@ static wchar_t * prompt(EditLine *el)
4949 return wc_prompt;
5050}
5151
52// lg_readline()is called via a chain of functions:
52// lg_readline() is called via a chain of functions:
5353// fget_input_string -> get_line -> get_terminal_line -> lg_readline.
5454// To avoid changing all of them, this variable is static for now.
5555// FIXME: Move the call of find_history_filepath() to lg_readline(), and