@@ -161,30 +161,31 @@ GNUC_UNUSED static void print_x_node(X_node *x)
161161 * This function was mainly used to support using empty-words, a concept
162162 * that has been eliminated. However, it is still used to support linking of
163163 * quotes that don't get the QUc/QUd links.
164+ *
165+ * This function is called only if ZZZ is defined in the dictionary.
166+ * This is currently used only by the English dict, to allow quotes to
167+ * appear anywhere in the sentence.
164168 */
165169static void add_empty_word (Sentence sent , X_node * x )
166170{
167- Exp * zn , * an ;
168- const char * ZZZ = string_set_lookup (EMPTY_CONNECTOR , sent -> dict -> string_set );
169- /* This function is called only if ZZZ is in the dictionary. */
170-
171171 /* The left-wall already has ZZZ-. The right-wall will not arrive here. */
172172 if (MT_WALL == x -> word -> morpheme_type ) return ;
173173
174174 /* Replace plain-word-exp by {ZZZ+} & (plain-word-exp) in each X_node. */
175175 for (; NULL != x ; x = x -> next )
176176 {
177- /* Ignore stems for now, decreases a little the overhead for
178- * stem-suffix languages. */
177+ /* Ignore stems for now; this decreases the overhead a little
178+ * for stem-suffix languages. */
179179 if (is_stem (x -> string )) continue ; /* Avoid an unneeded overhead. */
180180 //lgdebug(+0, "Processing '%s'\n", x->string);
181181
182182 /* zn points at {ZZZ+} */
183- zn = make_connector_node (sent -> dict , sent -> Exp_pool , ZZZ , '+' , false);
183+ Exp * zn = make_connector_node (sent -> dict ,
184+ sent -> Exp_pool , sent -> dict -> zzz_connector , '+' , false);
184185 zn = make_optional_node (sent -> Exp_pool , zn );
185186
186187 /* an will be {ZZZ+} & (plain-word-exp) */
187- an = make_and_node (sent -> Exp_pool , zn , x -> exp );
188+ Exp * an = make_and_node (sent -> Exp_pool , zn , x -> exp );
188189
189190 x -> exp = an ;
190191 }
@@ -257,7 +258,17 @@ static bool determine_word_expressions(Sentence sent, Gword *w,
257258 * supposing that the word has it in all of its dict entries
258259 * (in any case, currently there is only 1 entry for each such word).
259260 * Note that ZZZ_added starts by 0 and so also wordpos, and that the
260- * first sentence word (usually LEFT-WALL) doesn't need a check. */
261+ * first sentence word (usually LEFT-WALL) doesn't need a check.
262+ *
263+ * At this time, the empty-connector device is used only by the
264+ * English dict, to allow quotation marks to appear in random
265+ * locations in sentences. Rather than writing the English dict
266+ * so that *every word* has an optional {ZZZ-} & connector on it,
267+ * which would double the size of the dict, we instead add it here,
268+ * dynamically, on-the-fly, as needed. This whole thing feels
269+ * half-baked to me. It works, but is this weird exception being
270+ * made for one language.
271+ */
261272 if ((wordpos != * ZZZ_added ) && is_exp_like_empty_word (dict , we -> exp ))
262273 {
263274 lgdebug (D_DWE , " (has ZZZ-)" );
0 commit comments