+static char *
+get_documents_as_string (const struct dictionary *dict)
+{
+ const struct string_array *documents = dict_get_documents (dict);
+ struct string s = DS_EMPTY_INITIALIZER;
+ for (size_t i = 0; i < documents->n; i++)
+ {
+ if (i)
+ ds_put_byte (&s, '\n');
+ ds_put_cstr (&s, documents->strings[i]);
+ }
+ return ds_steal_cstr (&s);
+}
+