Giter Club home page Giter Club logo

wolper's Introduction

wolper

What is this

This is a helper program for solving wordle.

System overview

system overview

How to build

Just execute the make command.

How to use

CLI

  1. Get English text data to construct the wolper's dictionary.
  2. Assuming the input texts are located in input directory, you can build the dictionary file named dict.txt by the following command.
    ./wolper build [-i input] [-o dict.txt]
    
  3. Run the wolper server as follows.
    ./wolper server [-i dict.txt] [-p TCP port#]
    
  4. Run the wolper client as follows.
    ./wolper query [-k key] [-i included characters] [-e excluded characters] [--pos_exclude colon-separated characters] [-a IP address] [-p TCP port#] [-u] [--entsort]
    
    The sample output is shown below.
    $ ./wolper query -k fi.er -e powghtl
    address: localhost
    port: 8080
    include: 
    exclude: powghtl
    key: fi.er
    Connection succeeded.
    fiber
    finer
    fixer
    $ ./wolper query -k .z..e --entsort --pos_exclude bmj:::f:
    address: localhost
    port: 8081
    key: .z..e
    include: 
    exclude: 
    posExclude: bmj:::f:
    uniq: false
    entsort: true
    Connection succeeded.
    ozone
    ozzie
    azure
    

Unique search

If the unique search is enabled by "--uniq" flag, the result only includes words which consists of unique characters, that is, words not including the duplicated characters.

For example, a word "crane" is good, but "hello" is not allowed since it contains two "l"s in a single word.

Entropy based sorting

If the entropy based sorting is enabled by "--entsort" flag, the result is sorted according to the entropy score. If you choose the first word from the result, which has the highest entropy score, you can expect to get the correct word in the fastest way.

For the theoretical background, please check this blog post.

Exclusion for each position

Sometimes you might want to search words which include some characters, but you would not like the characters to sit in a specific position. In that case, you can use "--pos_exclude" option. You should specify the colon-separated characters as a value of the option. Each characters are then split with the colon and work as a exclusion list for each position.

For example, if you specify "ab:c::d:", the result does not contains the words which starts with "a" or "b", or contains "c" as a second character, or contains "d" for a fourth position.

Web interface

The way to start the wolper server is the same with that of CLI. Web interface can be used by the following steps.

  1. Run the wolper web server as follows.
    ./wolper web [-a IP address] [-p TCP port#] [--wolper_port TCP port# of wolper server]
    
    Note that the IP address here is wolper server's one, not web server's. Also note that the TCP port# is for the web server whcich your are about to start.
  2. Access to http://localhost:"TCP port#" on your web browser.

wolper's People

Contributors

peng225 avatar

Watchers

James Cloos avatar  avatar

wolper's Issues

Some query unexpectedly return nothing

My dictionary contains the word "skill" as follows.

shinya@DESKTOP-Q1NSEEU:~/go/wolper% ./wolper query -k skill                          
address: localhost
port: 8080
include: 
exclude: 
key: skill
Connection succeeded.
skill

However, the following query does not return "skill" as a result. This is an unexpecrted behavior.

shinya@DESKTOP-Q1NSEEU:~/go/wolper% ./wolper query -k ..i..  -e unteovaryzchbp -i lls
address: localhost
port: 8080
include: lls
exclude: unteovaryzchbp
key: ..i..
Connection succeeded.

Support recursive input

Currently, input files are assumed to be put in a one directory. So descendent directories are ignored.
It is better to support recursive input directory structure.

Helm test

There is no test code for helm charts.

Need tests

Currently, there are no test code for wolper. At least some unit tests and E2E tests are required.

Garbage words are included in the resulting array.

When wolper query command is executed, the garbage data is sometimes returned.

Example:

shinya@DESKTOP-Q1NSEEU:~/go/wolper% ./wolper query -k a.. 
address: localhost
port: 8080
include: 
exclude: 
key: a..
Connection succeeded.
a-1
a-4
a-6
a-b
a-e
a/c
...

Debug info in README

The following line in README is currently not output.

service.ClientQeury called (addrAndPort = localhost:8080).

README should be updated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.