diff --git a/static/index.html b/static/index.html
index 5d11c7a..d8435bd 100644
--- a/static/index.html
+++ b/static/index.html
@@ -291,10 +291,11 @@ Double-click any word to look it up on the right.">
+
-
Type a word and hit Go, or double-click a word in your draft. A phonetic readout pins on top; the buttons switch rhymes and synonyms.
+
Type a word and hit Go, or double-click a word in your draft. A phonetic readout pins on top; the buttons switch rhymes, synonyms, and describing words. Tip: end a word with “?” to jump to synonyms.
@@ -624,7 +625,14 @@ const lookupInput = document.getElementById('lookupInput');
lookupInput.addEventListener('focus', ()=> lookupInput.select());
const resultsBox = document.getElementById('lookupResults');
async function doLookup(){
- const word = document.getElementById('lookupInput').value.trim();
+ let word = document.getElementById('lookupInput').value.trim();
+ // RhymeZone-style: a trailing ? jumps to synonyms
+ if(word.endsWith('?')){
+ word = word.slice(0, -1).trim();
+ document.getElementById('lookupInput').value = word;
+ if(word) setMode('syn');
+ return;
+ }
if(!word) return;
document.getElementById('tab-lookup').scrollTop = 0;
// the card belongs to the word, not the submode: rebuild only when
@@ -638,6 +646,10 @@ async function doLookup(){
try{
const r = await fetch(`/api/lookup?word=${encodeURIComponent(word)}&mode=${mode}`);
const data = await r.json();
+ if(mode === 'desc'){
+ renderDescribes(word);
+ return;
+ }
if(mode === 'syn'){
if(!data.known){
resultsBox.innerHTML = `
No synonyms found for “${esc(word)}”.
`;
@@ -715,6 +727,23 @@ async function showDefinition(word){
(mates.length ? ` in your draft: ${mates.map(esc).join(', ')}` : '');
}catch(e){}
}
+async function renderDescribes(word){
+ resultsBox.innerHTML = '
Searching…
';
+ try{
+ const r = await fetch(`https://api.datamuse.com/words?rel_jjb=${encodeURIComponent(word)}&max=60`);
+ const data = await r.json();
+ const words = data.map(d=>d.word);
+ if(!words.length){
+ resultsBox.innerHTML = `