scalaz.example.ExampleBKTree.scala Maven / Gradle / Ivy
package scalaz.example
import scalaz._
// Example use of a Burkhard-Keller tree for approximate-based searching
object ExampleBKTree {
def main(args: Array[String]) = run
import Scalaz._
def run {
val t = dictionary.bktree
// The tree contains "zebra"
t -?- "zebra" assert_≟ true
// The tree does not contain "zerba"
t -?- "zerba" assert_≟ false
// The tree contains an entry within a distance of 1 of "zeba"
t =?= ("zeba", 1) assert_≟ true
// The tree does not contain an entry with a distance of 2 of "zebazz"
t =?= ("zebazz", 2) assert_≟ false
// All tree entries within a distance of 2 of "id"
t |=| ("id", 2) assert_≟ List("S", "Sb", "Sc", "Se", "Si", "Sm", "Sn", "Sq", "Sr", "St", "z", "Sid", "zed", "zip", "zit")
}
val dictionary = List("S","S's","Saab","Saab's","Saar","Saar's","Saarinen","Saarinen's","Sabbath","Sabbath's","Sabbaths","Sabik","Sabik's","Sabin","Sabin's","Sabina","Sabina's","Sabine","Sabine's","Sabre","Sabre's","Sabrina","Sabrina's","Sacajawea","Sacco","Sacco's","Sachs","Sachs's","Sacramento","Sacramento's","Sadat","Sadat's","Saddam","Saddam's","Sadducee","Sadducee's","Sade","Sade's","Sadie","Sadie's","Sadr","Sadr's","Safavid","Safavid's","Safeway","Safeway's","Sagan","Sagan's","Saginaw","Saginaw's","Sagittarius","Sagittarius's","Sagittariuses","Sahara","Sahara's","Sahel","Saigon","Saigon's","Saiph","Saiph's","Sakai","Sakai's","Sakha","Sakha's","Sakhalin","Sakhalin's","Sakharov","Sakharov's","Saki","Saki's","Saks","Sal","Sal's","Saladin","Saladin's","Salado","Salado's","Salamis","Salamis's","Salas","Salas's","Salazar","Salazar's","Salem","Salem's","Salerno","Salerno's","Salinas","Salinger","Salinger's","Salisbury","Salisbury's","Salish","Salish's","Salk","Salk's","Sallie","Sallie's","Sallust","Sallust's","Sally","Sally's","Salome","Salome's","Salton","Salton's","Salvador","Salvador's","Salvadoran","Salvadorans","Salvadorian","Salvadorians","Salvatore","Salvatore's","Salween","Salween's","Salyut","Salyut's","Sam","Sam's","Samantha","Samantha's","Samar","Samar's","Samara","Samara's","Samaritan","Samaritan's","Samaritans","Samarkand","Samarkand's","Sammie","Sammie's","Sammy","Sammy's","Samoa","Samoan","Samoset","Samoset's","Samoyed","Samoyed's","Sampson","Sampson's","Samson","Samson's","Samsonite","Samsonite's","Samuel","Samuel's","Samuelson","Samuelson's","San","San's","Sana","Sana's","Sanchez","Sanchez's","Sancho","Sancho's","Sand","Sand's","Sandburg","Sandburg's","Sanders","Sandinista","Sandoval","Sandoval's","Sandra","Sandra's","Sandy","Sandy's","Sanford","Sanford's","Sanforized","Sang","Sang's","Sanger","Sanger's","Sanhedrin","Sanhedrin's","Sanka","Sanka's","Sankara","Sankara's","Sanskrit","Sanskrit's","Santa","Santa's","Santana","Santana's","Santayana","Santayana's","Santeria","Santiago","Santiago's","Santos","Sappho","Sappho's","Sapporo","Sapporo's","Sara","Sara's","Saracen","Saracen's","Saracens","Saragossa","Saragossa's","Sarah","Sarah's","Sarajevo","Sarajevo's","Saran","Saran's","Sarasota","Sarasota's","Saratov","Saratov's","Sarawak","Sarawak's","Sardinia","Sardinia's","Sargasso","Sargasso's","Sargent","Sargent's","Sargon","Sargon's","Sarnoff","Sarnoff's","Saroyan","Saroyan's","Sarto","Sarto's","Sartre","Sartre's","Sasha","Sasha's","Saskatchewan","Saskatchewan's","Saskatoon","Saskatoon's","Sasquatch","Sassanian","Sassoon","Sassoon's","Sat","Sat's","Satan","Satan's","Satanism","Satanism's","Satanist","Satanist's","Saturday","Saturday's","Saturdays","Saturn","Saturn's","Saturnalia","Saturnalia's","Saudi","Saudis","Saul","Saul's","Saunders","Saundra","Saundra's","Saussure","Saussure's","Sauterne","Savage","Savage's","Savannah","Savannah's","Savior","Savior's","Savonarola","Savonarola's","Savoy","Savoy's","Savoyard","Savoyard's","Sawyer","Sawyer's","Saxon","Saxon's","Saxons","Saxony","Saxony's","Sayers","Sb","Sb's","Sc","Sc's","Scandinavia","Scandinavia's","Scandinavian","Scandinavians","Scaramouch","Scaramouch's","Scarborough","Scarborough's","Scarlatti","Scarlatti's","Scheat","Scheat's","Schedar","Schedar's","Scheherazade","Scheherazade's","Schelling","Schelling's","Schenectady","Schenectady's","Schick","Schick's","Schiller","Schiller's","Schindler","Schindler's","Schlesinger","Schlesinger's","Schliemann","Schliemann's","Schlitz","Schlitz's","Schmidt","Schmidt's","Schnabel","Schnabel's","Schnauzer","Schnauzer's","Schneider","Schneider's","Schoenberg","Schoenberg's","Schopenhauer","Schopenhauer's","Schrieffer","Schrieffer's","Schroeder","Schroeder's","Schrödinger","Schubert","Schubert's","Schultz","Schultz's","Schulz","Schulz's","Schumann","Schumann's","Schuyler","Schuyler's","Schuylkill","Schuylkill's","Schwartz","Schwartz's","Schwarzenegger","Schwarzenegger's","Schwarzkopf","Schwarzkopf's","Schweitzer","Schweitzer's","Schweppes","Schweppes's","Schwinger","Schwinger's","Schwinn","Schwinn's","Scientology","Scientology's","Scipio","Scipio's","Scopes","Scopes's","Scorpio","Scorpio's","Scorpios","Scorpius","Scorpius's","Scorsese","Scorsese's","Scot","Scot's","Scotch","Scotches","Scotchman","Scotchman's","Scotchmen","Scotland","Scotland's","Scots","Scotsman","Scotsman's","Scotsmen","Scotswoman","Scotswomen","Scott","Scott's","Scottie","Scottie's","Scottish","Scottsdale","Scottsdale's","Scotty","Scotty's","Scrabble","Scrabble's","Scranton","Scranton's","Scriabin","Scriabin's","Scribner","Scribner's","Scripture","Scripture's","Scriptures","Scrooge","Scrooge's","Scruggs","Scruggs's","Scud","Sculley","Sculley's","Scylla","Scylla's","Scythia","Scythia's","Scythian","Se","Seaborg","Seaborg's","Seagram","Seagram's","Sean","Sean's","Sears","Sears's","Seattle","Seattle's","Sebastian","Sebastian's","Sec","Seconal","Secretariat","Secretariat's","Secretaries","Secretary","Seder","Seder's","Seders","Seebeck","Seebeck's","Sega","Sega's","Segovia","Segovia's","Segre","Segre's","Segundo","Segundo's","Seiko","Seiko's","Seine","Seine's","Seinfeld","Seinfeld's","Sejong","Sejong's","Selassie","Selassie's","Selectric","Selectric's","Selena","Selena's","Seleucid","Seleucid's","Seleucus","Seleucus's","Selim","Selim's","Seljuk","Seljuk's","Selkirk","Selkirk's","Sellers","Sellers's","Selma","Selma's","Selznick","Selznick's","Semarang","Semarang's","Seminole","Seminole's","Seminoles","Semiramis","Semiramis's","Semite","Semite's","Semites","Semitic","Semitic's","Semitics","Semtex","Sen","Senate","Senate's","Senates","Senator","Sendai","Sendai's","Seneca","Seneca's","Senecas","Senegal","Senegal's","Senegalese","Senghor","Senghor's","Senior","Seniors","Sennacherib","Sennacherib's","Sennett","Sennett's","Sensurround","Sensurround's","Seoul","Seoul's","Sephardi","Sephardi's","Sepoy","Sepoy's","Sept","Sept's","September","September's","Septembers","Septuagint","Septuagint's","Septuagints","Sequoya","Sequoya's","Serb","Serb's","Serbia","Serbia's","Serbian","Serbians","Serbs","Serena","Serena's","Serengeti","Serengeti's","Sergei","Sergei's","Sergio","Sergio's","Serpens","Serpens's","Serra","Serra's","Serrano","Serrano's","Set","Set's","Seth","Seth's","Seton","Seton's","Seurat","Seurat's","Seuss","Seuss's","Sevastopol","Sevastopol's","Severn","Severn's","Severus","Severus's","Seville","Seville's","Seward","Seward's","Sextans","Sextans's","Sexton","Sexton's","Seychelles","Seyfert","Seymour","Seymour's","Sgt","Shackleton","Shackleton's","Shaffer","Shaffer's","Shaka","Shaka's","Shakespeare","Shakespeare's","Shakespearean","Shakespeareans","Shana","Shana's","Shane","Shane's","Shanghai","Shanghai's","Shanna","Shanna's","Shannon","Shannon's","Shantung","Shantung's","Shapiro","Shapiro's","Shari","Shari'a","Shari's","Sharlene","Sharlene's","Sharon","Sharon's","Sharp","Sharp's","Sharpe","Sharpe's","Sharron","Sharron's","Shasta","Shasta's","Shaula","Shaula's","Shaun","Shaun's","Shauna","Shauna's","Shavian","Shavuot","Shavuot's","Shaw","Shaw's","Shawn","Shawn's","Shawna","Shawna's","Shawnee","Shawnee's","Shcharansky","Shcharansky's","Shea","Shea's","Sheba","Sheba's","Shebeli","Shebeli's","Sheena","Sheena's","Sheetrock","Sheffield","Sheffield's","Sheila","Sheila's","Shelby","Shelby's","Sheldon","Sheldon's","Shelia","Shelia's","Shelley","Shelley's","Shelly","Shelly's","Shelton","Shelton's","Shenandoah","Shenandoah's","Shenyang","Shenyang's","Sheol","Sheol's","Shepard","Shepard's","Shepherd","Shepherd's","Sheppard","Sheppard's","Sheratan","Sheratan's","Sheraton","Sheraton's","Sheree","Sheree's","Sheri","Sheri's","Sheridan","Sheridan's","Sherlock","Sherlock's","Sherman","Sherman's","Sherpa","Sherpa's","Sherpas","Sherri","Sherri's","Sherrie","Sherrie's","Sherry","Sherry's","Sherwood","Sherwood's","Sheryl","Sheryl's","Shetland","Shetlands","Shevardnadze","Shevardnadze's","Shevat","Shevat's","Shi'ite","Shields","Shields's","Shijiazhuang","Shikoku","Shikoku's","Shillong","Shillong's","Shiloh","Shiloh's","Shinto","Shinto's","Shintoism","Shintoisms","Shintos","Shiraz","Shiraz's","Shirley","Shirley's","Shiva","Shiva's","Shockley","Shockley's","Short","Short's","Shorthorn","Shorthorn's","Shoshone","Shoshone's","Shostakovitch","Shostakovitch's","Shreveport","Shreveport's","Shriner","Shriner's","Shropshire","Shropshire's","Shula","Shula's","Shylock","Shylock's","Shylockian","Shylockian's","Si","Si's","Siam","Siam's","Siamese","Siamese's","Sian","Sian's","Sibelius","Sibelius's","Siberia","Siberia's","Siberian","Sibyl","Sibyl's","Sicilian","Sicilians","Sicily","Sicily's","Sid","Sid's","Siddhartha","Siddhartha's","Sidney","Sidney's","Siegfried","Siegfried's","Siemens","Siemens's","Sierpinski","Sierpinski's","Sigismund","Sigismund's","Sigmund","Sigmund's","Sigurd","Sigurd's","Sihanouk","Sihanouk's","Sikh","Sikh's","Sikhism","Sikhism's","Sikhisms","Sikhs","Sikkim","Sikkim's","Sikkimese","Sikorsky","Sikorsky's","Silas","Silas's","Silurian","Silva","Silva's","Silvia","Silvia's","Simenon","Simenon's","Simmental","Simmons","Simmons's","Simon","Simon's","Simone","Simone's","Simpson","Simpson's","Sims","Sinai","Sinai's","Sinatra","Sinatra's","Sinclair","Sinclair's","Sindbad","Sindbad's","Sindhi","Sindhi's","Singapore","Singapore's","Singer","Singer's","Singleton","Singleton's","Sinhalese","Sinhalese's","Sinkiang","Sinkiang's","Sioux","Sioux's","Sirius","Sirius's","Sister","Sisters","Sistine","Sisyphean","Sisyphus","Sisyphus's","Siva","Siva's","Sivan","Sivan's","Sjaelland","Sjaelland's","Skinner","Skinner's","Skippy","Skippy's","Skopje","Skopje's","Skye","Skye's","Skylab","Skylab's","Slater","Slater's","Slav","Slav's","Slavic","Slavic's","Slavonic","Slavonic's","Slavs","Slinky","Slinky's","Sloan","Sloan's","Sloane","Sloane's","Slocum","Slocum's","Slovak","Slovakia","Slovakia's","Slovakian","Slovakians","Slovaks","Slovenia","Slovenia's","Slovenian","Slovenians","Slurpee","Slurpee's","Sm","Sm's","Small","Small's","Smetana","Smetana's","Smirnoff","Smirnoff's","Smith","Smith's","Smithson","Smithson's","Smithsonian","Smithsonian's","Smokey","Smokey's","Smolensk","Smolensk's","Smollett","Smollett's","Smuts","Smuts's","Sn","Sn's","Snake","Snapple","Snapple's","Snead","Snead's","Snell","Snell's","Snickers","Snickers's","Snider","Snider's","Snoopy","Snoopy's","Snow","Snow's","Snowbelt","Snowbelts","Snyder","Snyder's","Soave","Socorro","Socorro's","Socrates","Socrates's","Socratic","Soddy","Soddy's","Sodom","Sodom's","Sofia","Sofia's","Soho","Soho's","Sol","Sol's","Solis","Solis's","Solomon","Solomon's","Solomons","Solon","Solon's","Solzhenitsyn","Solzhenitsyn's","Somali","Somali's","Somalia","Somalia's","Somalian","Somalians","Somalis","Somme","Somme's","Somoza","Somoza's","Son","Son's","Sondheim","Sondheim's","Sondra","Sondra's","Songhai","Songhai's","Songhua","Songhua's","Sonia","Sonia's","Sonja","Sonja's","Sonny","Sonny's","Sontag","Sontag's","Sony","Sony's","Sonya","Sonya's","Sophia","Sophia's","Sophie","Sophie's","Sophoclean","Sophocles","Sophocles's","Sopwith","Sopwith's","Sorbonne","Sorbonne's","Sosa","Sosa's","Soto","Soto's","Souphanouvong","Souphanouvong's","Sousa","Sousa's","South","South's","Southampton","Southampton's","Southeast","Southeast's","Southeasts","Southerner","Southerner's","Southerners","Southey","Southey's","Souths","Southwest","Southwest's","Southwests","Soviet","Soviets","Soweto","Soweto's","Soyinka","Soyinka's","Soyuz","Soyuz's","Spaatz","Spaatz's","Spackle","Spahn","Spahn's","Spain","Spain's","Spam","Spam's","Spaniard","Spaniard's","Spaniards","Spanish","Spanish's","Sparks","Sparta","Sparta's","Spartacus","Spartacus's","Spartan","Spartans","Spears","Spence","Spence's","Spencer","Spencer's","Spencerian","Spengler","Spengler's","Spenglerian","Spenser","Spenser's","Spenserian","Sperry","Sperry's","Sphinx","Sphinx's","Spica","Spica's","Spielberg","Spielberg's","Spillane","Spillane's","Spinoza","Spinoza's","Spinx","Spinx's","Spiro","Spiro's","Spirograph","Spirograph's","Spitsbergen","Spitsbergen's","Spitz","Spitz's","Spock","Spock's","Spokane","Spokane's","Springfield","Springfield's","Springsteen","Springsteen's","Sprint","Sprint's","Sprite","Sprite's","Sputnik","Sq","Sq's","Squanto","Squibb","Squibb's","Sr","Srinagar","Srinagar's","Srivijaya","Srivijaya's","St","St's","Stacey","Stacey's","Staci","Staci's","Stacie","Stacie's","Stacy","Stacy's","Stael","Stael's","Stafford","Stafford's","StairMaster","Stalin","Stalin's","Stalingrad","Stalingrad's","Stalinist","Stallone","Stallone's","Stamford","Stamford's","Stan","Stan's","Standish","Standish's","Stanford","Stanford's","Stanislavsky","Stanislavsky's","Stanley","Stanley's","Stanton","Stanton's","Staples","Staples's","Starbucks","Stark","Stark's","Starkey","Starkey's","Starr","Starr's","Staten","Staten's","Steadicam","Steele","Steele's","Stefan","Stefan's","Stefanie","Stefanie's","Stein","Stein's","Steinbeck","Steinbeck's","Steinem","Steinem's","Steiner","Steiner's","Steinmetz","Steinmetz's","Steinway","Steinway's","Stella","Stella's","Stendhal","Stendhal's","Stengel","Stengel's","Stephan","Stephan's","Stephanie","Stephanie's","Stephen","Stephen's","Stephens","Stephenson","Stephenson's","Sterling","Sterling's","Stern","Stern's","Sterne","Sterne's","Sterno","Stetson","Stetson's","Steuben","Steuben's","Steve","Steve's","Steven","Steven's","Stevens","Stevenson","Stevenson's","Stevie","Stevie's","Stewart","Stewart's","Stieglitz","Stieglitz's","Stilton","Stilton's","Stimson","Stimson's","Stine","Stine's","Stirling","Stirling's","Stockhausen","Stockhausen's","Stockholm","Stockholm's","Stockton","Stockton's","Stoic","Stoic's","Stoicism","Stoicism's","Stokes","Stokes's","Stolichnaya","Stolichnaya's","Stolypin","Stolypin's","Stone","Stone's","Stonehenge","Stonehenge's","Stoppard","Stoppard's","Stout","Stout's","Stowe","Stowe's","Strabo","Strabo's","Stradivarius","Stradivarius's","Strasbourg","Strasbourg's","Strauss","Stravinsky","Stravinsky's","Streisand","Streisand's","Strickland","Strickland's","Strindberg","Strindberg's","Stromboli","Stromboli's","Strong","Strong's","Stu","Stu's","Stuart","Stuart's","Stuarts","Studebaker","Studebaker's","Stuttgart","Stuttgart's","Stuyvesant","Stuyvesant's","Stygian","Styrofoam","Styrofoams","Styron","Styron's","Styx","Styx's","Suarez","Suarez's","Subaru","Subaru's","Sucre","Sucre's","Sucrets","Sucrets's","Sudan","Sudan's","Sudanese","Sudanese's","Sudetenland","Sudetenland's","Sudra","Sudra's","Sue","Sue's","Suetonius","Suetonius's","Suez","Suez's","Suffolk","Suffolk's","Sufi","Sufi's","Sufism","Sufism's","Suharto","Suharto's","Sui","Sui's","Sukarno","Sukarno's","Sukkot","Sukkoth","Sukkoth's","Sukkoths","Sukkots","Sulawesi","Sulawesi's","Suleiman","Suleiman's","Sulla","Sulla's","Sullivan","Sullivan's","Sumatra","Sumatra's","Sumeria","Sumeria's","Sumerian","Sumerian's","Summer","Summer's","Summers","Sumner","Sumner's","Sumter","Sumter's","Sun","Sunbeam","Sunbeam's","Sunbelt","Sundanese","Sundas","Sunday","Sunday's","Sundays","Sung","Sung's","Sunkist","Sunkist's","Sunni","Sunni's","Sunnyvale","Sunnyvale's","Superbowl","Superbowl's","Superfund","Superfund's","Superglue","Superglue's","Superior","Superior's","Superman","Superman's","Surabaya","Surabaya's","Surat","Surat's","Surinam","Surinam's","Suriname","Surya","Surya's","Susan","Susan's","Susana","Susana's","Susanna","Susanna's","Susanne","Susanne's","Susie","Susie's","Susquehanna","Susquehanna's","Sussex","Sussex's","Sutherland","Sutherland's","Sutton","Sutton's","Suva","Suva's","Suwanee","Suwanee's","Suzanne","Suzanne's","Suzette","Suzette's","Suzhou","Suzhou's","Suzuki","Suzuki's","Suzy","Suzy's","Svalbard","Svalbard's","Sven","Sven's","Svengali","Swahili","Swahili's","Swahilis","Swammerdam","Swammerdam's","Swanee","Swanee's","Swansea","Swansea's","Swanson","Swanson's","Swazi","Swazi's","Swaziland","Swaziland's","Swede","Swede's","Sweden","Sweden's","Swedenborg","Swedenborg's","Swedes","Swedish","Sweeney","Sweeney's","Sweet","Sweet's","Swift","Swift's","Swinburne","Swinburne's","Swiss","Swissair","Swissair's","Swisses","Switzerland","Switzerland's","Sybil","Sybil's","Sydney","Sydney's","Sykes","Sykes's","Sylvester","Sylvester's","Sylvia","Sylvia's","Sylvie","Sylvie's","Synge","Synge's","Syracuse","Syracuse's","Syria","Syria's","Syriac","Syriac's","Syrian","Syrians","Szechuan","Szilard","Szilard's","Szymborska","Szymborska's","Sèvres","z","zanied","zanier","zanies","zaniest","zaniness","zaniness's","zany","zanying","zap","zapped","zapping","zaps","zeal","zeal's","zealot","zealot's","zealots","zealous","zealously","zealousness","zealousness's","zebra","zebra's","zebras","zebu","zebu's","zebus","zed","zed's","zeds","zenith","zenith's","zeniths","zephyr","zephyr's","zephyrs","zeppelin","zeppelin's","zeppelins","zero","zero's","zeroed","zeroes","zeroing","zeros","zest","zest's","zestful","zestfully","zests","zeta","zeta's","zigzag","zigzag's","zigzagged","zigzagging","zigzags","zilch","zillion","zillion's","zillions","zinc","zinc's","zinced","zincing","zincked","zincking","zincs","zing","zing's","zinged","zinger","zingers","zinging","zings","zinnia","zinnia's","zinnias","zip","zip's","zipped","zipper","zipper's","zippered","zippering","zippers","zippier","zippiest","zipping","zippy","zips","zircon","zircon's","zirconium","zirconium's","zircons","zit","zither","zither's","zithers","zits","zodiac","zodiac's","zodiacal","zodiacs","zombie","zombie's","zombies","zonal","zone","zone's","zoned","zones","zoning","zonked","zoo","zoo's","zoological","zoologist","zoologist's","zoologists","zoology","zoology's","zoom","zoomed","zooming","zooms","zoos","zucchini","zucchini's","zucchinis","zwieback","zwieback's","zygote","zygote's","zygotes")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy