CINXE.COM
MAC OS X meaning: Apple's operating system for computers - OneLook
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Gabarito:wght@400..900&family=Montserrat:wght@200;400;500&display=swap" rel="stylesheet"> <meta property="og:image" content="https://onelook.com/img/onelook2.png" /> <meta property="og:image:width" content="261" /> <meta property="og:image:height" content="74" /> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KCYRT3J03G"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KCYRT3J03G'); gtag('config', 'AW-1072671259'); </script> <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"> <link rel="manifest" href="/manifest.json"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileImage" content="/mstile-144x144.png"> <meta name="theme-color" content="#ffffff"> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="/ol2.css?v=26"> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" /> <title>MAC OS X meaning: Apple's operating system for computers - OneLook</title> <meta name="description" content="A powerful dictionary, thesaurus, and comprehensive word-finding tool."> <link rel="canonical" href="https://www.onelook.com/?w=Mac OS X" /> <script> function init() {document.form1.w.focus(); document.form1.w.select();} </script> <style> a:hover { text-decoration: bold; color: #FF0000; } a:active { text-decoration: bold; color: #FF0000; } </style> </head> <body> <form name="form1" id="olform" method="GET" action="/"><center> <br> <div class="ol_logo"> <a href="/?loc=lhp"> <div class="ol_logo_sunburst"> <svg id=logoray xmlns="http://www.w3.org/2000/svg" height="60px" viewBox="0 -1040 1040 1040" width="60px" fill="#f1cc39"> <path d="M450-810v-110h60v110h-60Zm0 770v-110h60v110h-60Zm360-410v-60h110v60H810Zm-770 0v-60h110v60H40Zm702-250-43-43 66-66 43 43-66 66ZM195-151l-43-43 66-66 43 43-66 66Zm570 0-66-66 43-43 66 66-43 43ZM218-700l-66-66 43-43 66 66-43 43Zm261.82 445Q386-255 320.5-320.68 255-386.35 255-480.18q0-93.82 65.68-159.32 65.67-65.5 159.5-65.5 93.82 0 159.32 65.68 65.5 65.67 65.5 159.5 0 93.82-65.68 159.32-65.67 65.5-159.5 65.5Zm.11-60Q549-315 597-362.93q48-47.94 48-117Q645-549 597.07-597q-47.94-48-117-48Q411-645 363-597.07q-48 47.94-48 117Q315-411 362.93-363q47.94 48 117 48Zm.07-165Z"/> <circle id=logosun cx="480" cy="-480" r="200" fill="#f1cc39"/> </div> <span class="ol_logo_text">OneLook</span></a></div> <input type="text" autocapitalize="none" name="w" id="olinput" size="30" value="Mac OS X"> </form> <div id="fb2"> <button type="button" class="btn" onClick="ol(true);"><strong class="modetitle">Definitions</strong></button><br> <button type="button" class="btn" onClick="ol(false);">Thesaurus</button> </div> </center> <div title="This is a new OneLook feature that gives you an ultra-concise definition for any word or phrase you can think of. It's a 5-word (or occasionally 6-word) computer-generated summary of how the word is used most often. Be aware that words can have multiple meanings! If there are other senses of the word, they are shown below." class="ol_inbrief"><span class="ol_inbrief_title">Usually means:</span> Apple's operating system for computers. </div> <div class="ol_tabs"> <span class="ol_selected_tab">Definitions</span> <a href="/?w=mac_os_x&related=1"><span class="ol_nonselected_tab">Related words</span></a> <a href="/?w=mac_os_x&phrases=1"><span class="ol_nonselected_tab">Phrases</span></a> <a href="/?w=mac_os_x&mentions=1"><span class="ol_nonselected_tab">Mentions</span></a> </div> <div id='main'> <div id='section-dicts'> We found 11 dictionaries that define the word <b>Mac OS X</b>: <br><br> <a name=all_gen></a><u><b>General</b></u> (2 matching dictionaries)<br> <OL START=1> <li><a rel="nofollow" href="https://dictionary.reference.com/search?q=Mac+OS+X">Mac OS X</a>: Dictionary.com <li><a rel="nofollow" href="https://en.wikipedia.org/wiki/Mac%20OS-X">Mac OS-X</a>, <a rel="nofollow" href="https://en.wikipedia.org/wiki/Mac%20OS%20X">Mac OS X</a>, <a rel="nofollow" href="https://en.wikipedia.org/wiki/Mac%20os%20x">Mac os x</a>: Wikipedia, the Free Encyclopedia </ol><br> <a name=all_com></a><u><b>Computing</b></u> (5 matching dictionaries)<br> <OL START=3> <li><a rel="nofollow" href="https://foldoc.org/Mac+OS+X">Mac OS X</a>: Free On-line Dictionary of Computing <li><a rel="nofollow" href="https://www.computeruser.com/resources/dictionary/get by index/m/540/">Mac OS X</a>: CCI Computer <li><a rel="nofollow" href="https://www.techterms.com/definition/macosx">Mac OS X</a>: Tech Terms Computer Dictionary <font color=grey><li> Webopedia <i>(No longer online)</i></font> <li><a rel="nofollow" href="https://encyclopedia2.thefreedictionary.com/Mac+OS-X">Mac OS-X</a>, <a rel="nofollow" href="https://encyclopedia2.thefreedictionary.com/Mac+OS+X">Mac OS X</a>: Encyclopedia </ol><br> <a name=all_med></a><u><b>Medicine</b></u> (1 matching dictionary)<br> <OL START=8> <font color=grey><li> online medical dictionary <i>(No longer online)</i></font> </ol><br> <a name=all_misc></a><u><b>Miscellaneous</b></u> (1 matching dictionary)<br> <OL START=9> <li><a rel="nofollow" href="https://www.acronymfinder.com/af-query.asp?Acronym=MAC+OS+X&String=exact&p=ol">MAC OS X</a>: Acronym Finder </ol><br> <a name=all_slang></a><u><b>Slang</b></u> (1 matching dictionary)<br> <OL START=10> <li><a rel="nofollow" href="https://www.urbandictionary.com/define.php?term=mac%20os%20x">mac os x</a>: Urban Dictionary </ol><br> <a name=all_tech></a><u><b>Tech</b></u> (1 matching dictionary)<br> <OL START=11> <font color=grey><li> Sweetwater Music <i>(No longer online)</i></font> </ol><br> </div> <div id='section-defn'> <div class=ol_searchassist> <a href="https://www.google.com/search?as_q=%22mac+os+x%22&num=10&as_epq=&as_oq=definition&as_eq=&lr=lang_en&as_occt=any&as_dt=i&as_sitesearch=&safe=off">Google</a>, <a href="https://news.google.com/search?q=Mac_OS_X&hl=en-US&gl=US&ceid=US%3Aen">News</a>, <a href="https://www.google.com/search?udm=2&q=Mac_OS_X">Images</a>, <a href="https://en.wikipedia.org/wiki/Special:Search?go=Go&search=Mac_OS_X">Wikipedia</a>, <a href="https://www.reddit.com/search/?q=mac+os+x&type=comments&cId=3da8fc67-4604-4580-b2d9-678b1e867c12&iId=b711c12b-5289-4786-904c-daf03bbeff83&sort=new">Reddit</a>, <a href="https://bsky.app/search?q=Mac_OS_X">BlueSky</a> </div> <table class="info-box" cellpadding=0 width=><tr><td> <div class="entry" type="normal"> <br> <div class=relheader><b>Phrases:</b></div><div class=rellist> <nobr><a href=/?w=Mac+OS+X+Leopard&loc=rel_phrase>Mac OS X Leopard</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Jaguar&loc=rel_phrase>Mac OS X Jaguar</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Panther&loc=rel_phrase>Mac OS X Panther</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Tiger&loc=rel_phrase>Mac OS X Tiger</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Snow+Leopard&loc=rel_phrase>Mac OS X Snow Leopard</a>, </nobr> <a href="/?w=**Mac_OS_X**&ssbp=1"><i>more...</i></a> </div> <div id="dmapi_cls"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' function clusterlink(clusterTitles, clusterId, query) { var clusterTitle = clusterTitles[clusterId][0]; var url = "https://www.onelook.com/?topic=" + clusterTitle + "&s=cluster:" + clusterId + "&loc=ol_cls"; url = url + "&f_rt=" + encodeURIComponent(query); url = url + "&concept=" + encodeURIComponent(clusterTitle); clslink = "<a href=\"" + url + "\"><button class=\"top-cluster\">" + clusterTitle + "</button></a> "; return clslink; } function toggle_dmapi_res(apifn) { var q = apifn; var max = "100"; if (apifn === "rhy") { q = "arhy=1&sl"; } if (apifn === "idioms") { q = "v=idioms&md=d&ml"; } if (apifn === "cls") { q = "qe=sp&md=c&sp"; max = "1"; } if (apifn === "ml") { q = "md=d&ml"; } if (apifn === "enwiki") { q = "v=enwiki&nonorm=1&sp"; } var apiquery = query; if (apifn == "enwiki") { apiquery += "*"; } $.ajax({ url: "//www.onelook.com/api/words?max=" + max + "&k=ol_related&" + q + "=" + apiquery, context: document.body }).done(function(data) { str = ""; if (apifn == "cls" && (data.length > 0)) { var tag_list = data[0]["tags"]; var clusterTitles = {}; var defClusters = []; for (var j=0; j<tag_list.length; j++) { if (tag_list[j].match(/^cluster_titles:/)) { clusterTitles = JSON.parse(tag_list[j].replace("cluster_titles:","")); } else if (tag_list[j].match(/^def_clusters:/)) { defClusters = JSON.parse(tag_list[j].replace("def_clusters:","")); } } var seenClusters = new Set(); if (defClusters.length > 0) { str += "<br>Found in concept groups: "; for (var i=0; i<defClusters.length; i++) { if (!seenClusters.has(defClusters[i])) { var clslink = clusterlink(clusterTitles, defClusters[i], query); if (clslink != null) { str += clslink; seenClusters.add(defClusters[i]); } } } if (defClusters.length >= 1) { str += " <a href=\"/thesaurus?loc=olvt&viz=1&s=" + query + "\"><button id=viz-teaser-button>View in Idea Map</button></a> "; } } } else { for (i=0; i<data.length; i++) { if (apifn === "rhy" && (data[i]["word"] === query.replace("_", " "))) { continue; } url = baseurl + data[i]["word"]; if (data[i]["defHeadword"]) { data[i]["word"] = data[i]["defHeadword"]; } if (apifn == "enwiki") { url = "https://en.wikipedia.org/wiki/" + data[i]["word"]; } str += "<a href=\"" + url + "\">" + data[i]["word"] + "</a>"; if (i != data.length-1) { if (apifn == "enwiki") str += "<br>"; else str += ", "; } } } if (apifn === "ml" && data.length >= 100 || apifn === "idioms") { str += " (<b><i><a href=\"/thesaurus/?s=" + query + "&loc=cbsim\">see more...</a></i></b>)"; } if (apifn === "rhy" && data.length >= 99) { str += " (<b><i><a href=\"https://www.rhymezone.com/r/rhyme.cgi?typeofrhyme=adv&Word=" + query + "&loc=olrhy\">see more...</a></i></b>)"; } if (data.length == 0) { str += "(None found)"; } $("#dmapi_" + apifn).html(str); }); } toggle_dmapi_res('cls'); </script> <br>▸ <a class="dmapi_link" onclick="toggle_dmapi_res('ml')">Words similar to <i>Mac OS X</i></a> <div id="dmapi_ml"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' </script> <br>▸ <a href="/?w=Mac_OS_X&mentions=1">Usage examples for <i>Mac OS X</i></a><br> <br>▸ <a class="dmapi_link" onclick="toggle_dmapi_res('idioms')">Idioms related to <i>Mac OS X</i></a> <div id="dmapi_idioms"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' </script> <br>▸ <a class="dmapi_link" onclick="toggle_dmapi_res('enwiki')">Wikipedia articles (New!)</a> <div id="dmapi_enwiki"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' </script> <br>▸ <a class="dmapi_link" onclick="toggle_dmapi_res('rel_trg')">Words that often appear near <i>Mac OS X</i></a> <div id="dmapi_rel_trg"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' </script> <br>▸ <a target="_" href="https://www.rhymezone.com/r/rhyme.cgi?typeofrhyme=adv&Word=Mac_OS_X">Rhymes of <i>Mac OS X</i></a><br> <br>▸ <a href="pm/#?w1=Mac_OS_X">Invented words related to <i>Mac OS X</i></a><br> </td></tr></table></td></tr> </table></div> </div></div> <br> <center><table class="info-box" cellpadding="10" cellspacing="1" width=80%><tr><td><a name=phrases></a> <div class=relheader><b>Similar:</b></div><div class=rellist> <div id="dmapi_ml"></div> <script language=javascript type='text/javascript'> var query = 'Mac_OS_X'; var baseurl = '/?loc=dmapirel&w=' toggle_dmapi_res('ml'); </script> </div> <div class=relheader><b>Phrases:</b></div><div class=rellist> <nobr><a href=/?w=Mac+OS+X+Leopard&loc=rel_phrase>Mac OS X Leopard</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Jaguar&loc=rel_phrase>Mac OS X Jaguar</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Panther&loc=rel_phrase>Mac OS X Panther</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Tiger&loc=rel_phrase>Mac OS X Tiger</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Snow+Leopard&loc=rel_phrase>Mac OS X Snow Leopard</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+10.0&loc=rel_phrase>Mac OS X 10.0</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Server+1.0&loc=rel_phrase>Mac OS X Server 1.0</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+10.1&loc=rel_phrase>Mac OS X 10.1</a>, </nobr> <nobr><a href=/?w=Mac+OS+X+Public+Beta&loc=rel_phrase>Mac OS X Public Beta</a>, </nobr> <nobr><a href=/?w=Internet+Explorer+for+Mac+OS+X&loc=rel_phrase>Internet Explorer for Mac OS X</a>, </nobr> <a href="/?w=**Mac_OS_X**&ssbp=1"><i>more...</i></a> </div> </td></tr></table></center> <br><br> <br> <table width="100%" border=0 cellspacing=0> <tr> <td align=right> <hr><br> <center> <a href="https://www.onelook.com/">Home</a> <a href="/thesaurus/">Reverse Dictionary / Thesaurus</a> <a href="https://datamuse.com/">Datamuse</a> <a href="/games">Word games</a> <a href="https://onelook.com/spruce">Spruce</a> <a href="https://onelook.com/about.shtml#feedback">Feedback</a> <!-- <a href="https://onelook.com/about.shtml#privacy">Privacy</a> --> <a href="#" class="darkModeToggle">Dark mode</a> <a href="/random">Random word</a> <a href="/about.shtml">Help</a></center> </td></tr></table> <br> <br> <link rel="stylesheet" href="/cyj.min.css?6"> <script src="/cyj.min.js?3"></script> <style> #CONTAINER { margin: auto; border: 2px solid #ccf; border-radius: 10px; box-shadow: 3px 3px 3px #ddf; display: flex; width: fit-content; margin-bottom: 20px; } </style> <div id="CONTAINER"></div> <script> const get_call_to_action_msg = () => { const is_daily = 1; const msgs = [ 'Can you rearrange the words into a chain of 2-word phrases' ]; // return (1 ? "Daily game: " : "") + msgs[Math.floor(Math.random() * msgs.length)]; return msgs[Math.floor(Math.random() * msgs.length)]; } const init_cyj_game = () => { const add_tracker = (container, action, msg) => { const is_daily = 1; const rand = Math.random(); const img = document.createElement('img'); img.style.display = 'none'; img.src = `img/0.gif?x=cyj6&rand=${rand}&w=${is_daily}&action=${action}&msg=${msg}`; container.append(img); } const container = document.querySelector('#CONTAINER'); const is_daily = 1; const { starting_board, compound_info, min_moves } = {"puzzle_id": -1126716861957426173, "starting_board": ["positive", "double", "film", "student", "exchange", "body", "action", "stock", "negative"], "compound_info": [{"compound": ["positive", "action"], "name": "positive action", "connection_type": "C", "description": "(sociology) A form of affirmative action that attempts to assist members of an underrepresented group without prejudicing the criteria of selection by merit."}, {"compound": ["action", "film"], "name": "Action film", "connection_type": "C", "description": "a film genre in which the protagonist is thrust into a series of events that typically involve violence and physical feats."}, {"compound": ["film", "stock"], "name": "film stock", "connection_type": "C", "description": "A strip or sheet of transparent plastic film base coated on one side with a gelatin emulsion containing light-sensitive silver halide crystals, used for recording motion pictures."}, {"compound": ["stock", "exchange"], "name": "stock exchange", "connection_type": "C", "description": "A building that trades stocks in of companies for money and vice versa."}, {"compound": ["exchange", "student"], "name": "exchange student", "connection_type": "C", "description": "A student who is participating in a student exchange scheme."}, {"compound": ["student", "body"], "name": "student body", "connection_type": "C", "description": "All the students (pupils) enrolled at an educational institution."}, {"compound": ["body", "double"], "name": "body double", "connection_type": "C", "description": "A film stand-in for an actor, in scenes not involving the face, especially during scenes of nudity, or of dangerous activity."}, {"compound": ["double", "negative"], "name": "Double negative", "connection_type": "C", "description": "A double negative is a construction occurring when two forms of grammatical negation are used in the same sentence."}], "difficulty": 59.01, "winning_board": ["positive", "action", "film", "stock", "exchange", "student", "body", "double", "negative"], "min_moves": 4} ; const call_to_action_msg = get_call_to_action_msg().replace("[X]", starting_board[0]).replace("[Y]", starting_board[starting_board.length - 1]); /* add_tracker(container, 'render', call_to_action_msg); */ let helpstr = 'Pick up and drag the words to rearrange them into a chain in which every adjacent pair of words is a familiar two-word phrase like "hot dog". The pink words are the start and end of the chain and cannot be moved. When you have finished linking the words we\'ll show you the definitions of the phrases.'; if ("20250421".startsWith("def_")) helpstr = 'Pick up and drag the words to rearrange them into a valid definition for the word on the left.'; else if ("20250421".startsWith("proverb_")) helpstr = 'Pick up and drag the words to rearrange them into a grammatical proverb.'; helpstr = helpstr + ' If you want an extra challenge, try to make the chain in no more than ' + min_moves.toString() + ' moves.'; CompoundYourJoy.FromStandard(20250420, container, starting_board, compound_info, { help: helpstr, call_to_action: call_to_action_msg, play_again: "https://onelook.com/?loc=rd&w=cyj&gameid=20250421" }, { on_first_interaction: () => { add_tracker(container, 'first_interaction', ''); }, on_win: (num_moves, min_moves, duration) => { add_tracker(container, 'win', num_moves.toString() + '_' + min_moves.toString() + '_' + duration.toString()); }, on_share: () => { add_tracker(container, 'share', ''); }, on_definitions: () => { add_tracker(container, 'definitions', ''); }, }, min_moves ); } init_cyj_game(); </script> <style> /* Basic reset */ /* Container for the three boxes */ .games-container { font-family: "Gabarito", sans-serif; display: flex; /* Enable flex layout */ flex-wrap: wrap; /* Allow wrapping on smaller screens */ justify-content: center; /* Center the boxes horizontally */ gap: 20px; /* Space between items */ max-width: 1200px; margin: 0 auto; /* Center container in the page */ } /* Individual game box styling */ .game-box { flex: 1 1 200px; max-width: 200px; background: linear-gradient(135deg, darkblue, yellow); border-radius: 8px; padding: 20px; color: #fff; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: flex; flex-direction: column; justify-content: space-between; } .game-box1 { background: linear-gradient(165deg, darkblue, yellow); } .game-box2 { background: linear-gradient(180deg, darkblue, yellow); } .game-box3 { background: linear-gradient(195deg, darkblue, yellow); } .game-box h2 { margin-bottom: 10px; font-size: 1.5rem; } .game-box p { margin-bottom: 20px; line-height: 1.4; } /* Button styling */ .cta-button { display: inline-block; background-color: #fff; color: darkblue; text-decoration: none; padding: 10px 20px; border-radius: 4px; transition: background-color 0.3s, color 0.3s; } .cta-button:hover { background-color: #ff9800; color: #fff; } /* Responsive adjustments for smaller screens */ @media (max-width: 600px) { .game-box { max-width: 100%; /* Boxes will stretch to full width on small screens */ } } </style> <div class="games-container"> <!-- Threepeat Box --> <div class="game-box game-box1"> <h2>Color thesaurus</h2> <p> Use OneLook to find colors for words and words for colors </p> <a href="/?w=mauve&colors=1" class="cta-button">See an example</a> </div> <!-- Compound Your Joy Box --> <div class="game-box game-box2"> <h2>Literary notes</h2> <p> Use OneLook to learn how words are used by great writers </p> <a href="/?mentions=1&w=corpulence" class="cta-button">See an example</a> </div> <!-- Pandergram Box --> <div class="game-box game-box3"> <h2>Word games</h2> <p> Try our innovative vocabulary games </p> <a href="/games" class="cta-button">Play Now</a> </div> </div> <center><br>Read the latest OneLook newsletter issue: <a href="https://mailchi.mp/4f8c1144e9b8/welcome-fivearrive-prototype-10334093?e=c2ec53e2a5">Easter egg acrostics</a> </center> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <script> function highlightWildcard(item, pattern) { if (!pattern.endsWith('*')) { pattern += '*'; } const segments = pattern.split('*'); function parseSegment(segment) { return segment.split(''); } function buildSegmentRegex(tokens) { const groupPatterns = tokens.map(ch => { if (ch === '?') { return '([A-Za-z ])'; // capturing group for 1 letter/space } else { // Escape any regex special chars in case the pattern has them const escaped = ch.replace(/[.^$|\\()[\]{}*+?]/g, '\\$&'); return '(' + escaped + ')'; } }); return new RegExp('^' + groupPatterns.join(''), 'i') } function bold(text) { return `<span class="autocomplete_bolded">${text}</span>`; } function buildInvertedSegmentMatch(tokens, matchArray) { let out = ''; for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const actualChar = matchArray[i + 1]; // what we matched in the item if (token === '?') { out += bold(actualChar); } else { out += actualChar; } } return out; } let resultHTML = ''; let currentIndex = 0; for (const seg of segments) { if (!seg) { continue; } const tokens = parseSegment(seg); const segmentRegex = buildSegmentRegex(tokens); let matchPos = -1; let matchLength = 0; let matchArray = null; for (let startPos = currentIndex; startPos <= item.length; startPos++) { const substring = item.slice(startPos); const m = segmentRegex.exec(substring); if (m) { matchPos = startPos; matchLength = m[0].length; matchArray = m; break; } } if (matchPos === -1) { let iPos = currentIndex; // pointer into item let pPos = 0; // pointer into tokens[] while (iPos < item.length && pPos < tokens.length) { const token = tokens[pPos]; const itemChar = item[iPos]; if (token === '?') { iPos++; pPos++; } else { if (itemChar.toLowerCase() === token.toLowerCase()) { iPos++; pPos++; } else { break; } } } const matchedPrefix = item.slice(currentIndex, iPos); resultHTML += matchedPrefix; const leftover = item.slice(iPos); if (leftover) { resultHTML += `<span style="color:red;">${leftover}</span>`; } return resultHTML; } const gapText = item.slice(currentIndex, matchPos); if (gapText) { resultHTML += bold(gapText); } const matchedSegmentHTML = buildInvertedSegmentMatch(tokens, matchArray); resultHTML += matchedSegmentHTML; currentIndex = matchPos + matchLength; } const leftover = item.slice(currentIndex); if (leftover) { resultHTML += bold(leftover); } return resultHTML; } function ol(isForward, mode) { var x = $( "#olinput" ).val(); var url = "/"; if (isForward) { url = "/?w=" + encodeURIComponent(x); } else { url = "/thesaurus/"; if (x !== "") { url += "?s=" + encodeURIComponent(x); } } if (mode) { url += "&" + mode + "=1"; } if (url !== "/") { window.location.replace(url); } } $(function() { last_req = ""; const body = document.body; if (typeof(Storage) !== "undefined") { const savedTheme = localStorage.getItem('theme'); if (savedTheme) { body.className = savedTheme; } else { body.className = 'light-theme'; } } $(".darkModeToggle").click(() => { body.classList.toggle('dark-theme'); body.classList.toggle('light-theme'); if (typeof(Storage) !== "undefined") { $("#olinput").append('<img src="/img/0.gif?q=hometheme_' + body.className + '">'); localStorage.setItem('theme', body.className); } }); $( "#olinput" ).autocomplete( { minLength: 3, delay: 100, open: function(event, ui) { $('.ui-autocomplete').off('menufocus hover mouseenter mouseover'); }, select: function(event, ui) { if (ui.item.value.match("Symbols:")) { ui.item.value = $( "#thesinput").val(); return; } $('<input>').attr({ type: 'hidden', name: 'loc', value: 'home_ac_' + last_req }).appendTo('#olform'); $( "#olinput" ).val(ui.item.value); $( "#olform" ).submit(); }, source: function( request, response ) { var res = request.term.split(":"); var pattern = res[0]; var url; if (res.length > 1) { url = '//www.onelook.com/api/words?v=ol_gte2&md=d&max=10&k=ol_clue&sp=' + encodeURIComponent(res[0]) + '&ml=' + encodeURIComponent(res[1]); } else { url = '//www.onelook.com/api/sug?v=ol_gte2&k=ol_home&s=' + encodeURIComponent(request.term.replace(/[:].*/,'')); } $.ajax({ dataType: "json", type: 'GET', url: url, success: function(data) { data.push({"word": "Symbols: ? (match a letter), * (match many), // (unscramble)"}); response($.map(data, function(item) { item.word = item.word.replace(/[+]/g, ' '); var label = item.word; var definition = ""; if (item.defs && item.defs.length > 0) { var parts = item.defs[0].split("\t"); if (parts.length > 1) { definition = parts[1].trim().replace(/[_.]/g, ''); definition = definition.replace(/^:/, "→ "); // right arrow for descriptives definition = definition.length > 60 ? definition.slice(0, 60) + "..." : definition; } } return { label: label, // label is shown in the dropdown menu value: item.word, // value goes into the input box on selection highlight: (item.word === pattern ? ("<strong>" + pattern + "</strong>") : (item.word.match("Symbols:") ? item.word : highlightWildcard(item.word, pattern))), defs: definition, is_match: (item.word.toLowerCase() === pattern.toLowerCase()) }; })); } }); }}) .data("ui-autocomplete")._renderItem = function(ul, item) { var $li = $("<li>").appendTo(ul); var $word = $("<span>").html(item.highlight); // Definition on the right (in gray), but only if we have one if (item.defs) { var $def = $("<span class='definition'>").text(item.defs); if (item.is_match) { $def = $("<span class='definition definition_match'>").text(item.defs); } $li.append($word).append($def); } else { $li.append($word); } return $li; }; ; init(); }); </script> <br><br><br><br> </body></html>