-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6b1451
commit 0e6ce69
Showing
5 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="manifest" href="manifest.json" /> | ||
<title>Fuzzy list-of-names matcher - Debugging tool</title> | ||
<link rel="stylesheet" href="css/main.css" /> | ||
</head> | ||
<body> | ||
<h1>Name finder - debugging</h1> | ||
<div class="intro"> | ||
<p> | ||
The tools on this page are to help visualise & interactively | ||
experiment with the underlying functions used in the main | ||
<a href="/">Fuzzy list-of-names matcher</a>.<br /> | ||
Ideally use the unit tests to drive development for real feature | ||
building, but sometimes interactive playing with feature changes is | ||
quicker. | ||
</p> | ||
</div> | ||
<div class="entry"> | ||
<label> | ||
normalise | ||
<input type="text" id="normaliseInput" /><br /> | ||
<span id="normaliseOutput"></span> | ||
</label> | ||
<label> | ||
makeStemmed | ||
<input type="text" id="makeStemmedInput" /><br /> | ||
<span id="makeStemmedOutput"></span> | ||
</label> | ||
<label> | ||
makeVariations | ||
<input type="text" id="makeVariationsInput" /><br /> | ||
<span id="makeVariationsOutput"></span> | ||
</label> | ||
</div> | ||
<div class="entry"> | ||
<label> | ||
getScore | ||
<input type="text" id="getScoreInput" /><br /> | ||
</label> | ||
<label> | ||
getScore search list: | ||
<textarea id="getScoreSearchInput"></textarea> | ||
</label> | ||
<span id="getScoreOutput"></span> | ||
</div> | ||
<script src="js/debug.js"></script> | ||
<script> | ||
new EventSource("/esbuild").addEventListener("change", () => | ||
location.reload() | ||
); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
normalise, | ||
makeStemmed, | ||
makeVariations, | ||
getScore, | ||
makeMatchesMap, | ||
} from "./lib"; | ||
|
||
const normaliseInputEl = document.getElementById("normaliseInput"); | ||
const normaliseOutputEl = document.getElementById("normaliseOutput"); | ||
|
||
normaliseInputEl.addEventListener("input", () => { | ||
normaliseOutputEl.innerHTML = normalise(normaliseInputEl.value); | ||
}); | ||
|
||
const makeStemmedInputEl = document.getElementById("makeStemmedInput"); | ||
const makeStemmedOutputEl = document.getElementById("makeStemmedOutput"); | ||
|
||
makeStemmedInputEl.addEventListener("input", () => { | ||
makeStemmedOutputEl.innerHTML = makeStemmed(makeStemmedInputEl.value); | ||
}); | ||
|
||
const makeVariationsInputEl = document.getElementById("makeVariationsInput"); | ||
const makeVariationsOutputEl = document.getElementById("makeVariationsOutput"); | ||
|
||
makeVariationsInputEl.addEventListener("input", () => { | ||
makeVariationsOutputEl.innerHTML = makeVariations( | ||
makeVariationsInputEl.value | ||
).join("<br>"); | ||
}); | ||
|
||
const getScoreInputEl = document.getElementById("getScoreInput"); | ||
const getScoreSearchInput = document.getElementById("getScoreSearchInput"); | ||
const getScoreOutputEl = document.getElementById("getScoreOutput"); | ||
|
||
function updateMatchesMapOutput() { | ||
getScoreOutputEl.innerHTML = getScore( | ||
getScoreInputEl.value, | ||
makeMatchesMap(getScoreSearchInput.value.trim().split(/\r?\n/)) | ||
).join("<br>"); | ||
} | ||
|
||
getScoreInputEl.addEventListener("input", updateMatchesMapOutput); | ||
getScoreSearchInput.addEventListener("input", updateMatchesMapOutput); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters