Add support for experimental checks ("-e")

This commit is contained in:
Alan Orth 2021-03-13 23:01:11 +02:00
parent 198acdb1a7
commit 122d9fd53c
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 12 additions and 1 deletions

View File

@ -55,6 +55,9 @@ def process():
if "unsafe" in request.form:
args.append("-u")
if "experimental" in request.form:
args.append("-e")
# run subprocess and capture output as UTF-8 so we get a string instead of
# bytes for ansi2html
results = subprocess.run(

View File

@ -12,7 +12,7 @@
<input class="form-control" type="file" id="formFile" name="file" accept=".csv">
</div>
<p>Options</p>
<p>Basic options:</p>
<div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="unsafeCheckbox" name="unsafe">
@ -20,6 +20,14 @@
<div id="unsafeHelp" class="form-text">This will remove newlines and perform <a href="https://withblue.ink/2019/03/11/why-you-need-to-normalize-unicode-strings.html" title='When "Zoë" !== "Zoë". Or why you need to normalize Unicode strings'>normalization of Unicode characters</a>. Read more about these <a href="https://github.com/ilri/csv-metadata-quality#unsafe-fixes">unsafe fixes</a>.</div>
</div>
<p>Experimental options</p>
<div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="experimentalCheckbox" name="experimental">
<label class="form-check-label" for="experimentalCheckbox" aria-describedby="experimentalHelp">Enable experimental checks</label>
<div id="experimentalHelp" class="form-text">Attempt to validate whether the value of an item's <code>dc.language.iso</code> or <code>dcterms.language</code> field matches the <em>actual</em> language of text used in its title, abstract, and citation. Read more about these <a href="https://github.com/ilri/csv-metadata-quality#experimental-checks">experimental checks</a>.</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>