my $nf = $c->request->param('normal_form');
# TODO throw error unless $nf
$rdg->normal_form( $nf );
+ # TODO throw error if lemmatization fails
$rdg->lemmatize();
} else {
# Set all the values that we have for the reading.
}
$lx->disambiguate( $idx );
} elsif( $read_write_keys{$p} ) {
- $rdg->$p( $c->request->param( $p ) );
+ my $val = _clean_booleans( $rdg, $p, $c->request->param( $p ) );
+ $rdg->$p( $val );
}
}
}
}
+sub _clean_booleans {
+ my( $rdg, $param, $val ) = @_;
+ if( $rdg->meta->get_attribute( $param )->type_constraint->name eq 'Bool' ) {
+ $val = 1 if $val eq 'true';
+ $val = undef if $val eq 'false';
+ }
+ return $val;
+}
+
=head2 end
Attempt to render a view, if needed.