+
+bool
+measure_guesser_is_needed (struct dataset *ds)
+{
+ struct measurement_level_trns *mlt
+ = create_measurement_level_trns (dataset_dict (ds));
+ if (mlt)
+ {
+ add_measurement_level_trns_free__ (mlt);
+ return true;
+ }
+ return false;
+}
+
+void
+measure_guesser_run (struct dataset *ds, const struct casereader *reader)
+{
+ struct measurement_level_trns *mlt
+ = create_measurement_level_trns (dataset_dict (ds));
+ if (!mlt)
+ return;
+
+ struct casereader *r = casereader_clone (reader);
+ while (mlt->n_vars > 0)
+ {
+ struct ccase *c = casereader_read (r);
+ measurement_level_trns_run (mlt, c);
+ case_unref (c);
+ }
+ casereader_destroy (r);
+
+ measurement_level_trns_commit (mlt);
+ add_measurement_level_trns_free__ (mlt);
+}