String to CamelCase coverter using Word Break Dynamic Programming Approach
- All the words of the english alphabet have size greater than 3. Else Accuracy is very poor.
- dictionary API is essential.
- Pre-requisites are installed, environment is setup and if using Azure, knowledge of Creating containerized applications using Azure AppServices or creating container instance
dictionaryapi.go
: CamelCase coversionjsonops.go
: Class for Handling JSON Operations for RESTful Servicesmain.go
: Go RESTful webservice running on port 80CamelCase.json
: JSON file used for File Storage during RESTful Services Operationsconverter.go
: Implementation from String case to CamelCase conversion.
<>
: Mandatory Parameter and []
: Option Parameter
root@localhost $ git clone https://github.com/sribs/CamelCase
root@localhost $ go get github.com/gorilla/mux && go get github.com/sribs/CamelCase
root@localhost $ cd /path/to/CamelCase/; CamelCase <Dictionary API Endpoint> [<Application ID> <Application Key>]
root@localhost $ docker run sriharshabs/golangcamelcaseapi:test rest <Dictionary API Endpoint> [<Application ID> <Application Key>]
Please follow the Portal On Screen Instructions
- To get all CamelCase strings,
http://52.230.217.40/camelcase
- To perform a GET or DELETE for a particular string,
http://52.230.217.40/camelcase/<strname>
- To perform a POST for a particular string,
http://52.230.217.40/camelcase/<strname>/<minlength>
. minlength is a parameter that will greatly affect accuracy. To get good accuracy provide minlength=min(length of the valid subset word). This is mandatory - For Dictionary Endpoint, here is another API:
http://flaskenglishdict.centralus.azurecontainer.io/api/<word>
root@LinuxDebugging:/home/sribs/CamelApp/docker/golang# curl -vvv http://52.230.217.40/camelcase
* Trying 52.230.217.40...
* Connected to 52.230.217.40 (52.230.217.40) port 80 (#0)
> GET /camelcase HTTP/1.1
> Host: 52.230.217.40
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 08 Mar 2019 17:18:40 GMT
< Content-Length: 46
< Content-Type: text/plain; charset=utf-8
<
{"hello":"Hello","newgame":"NewGame","three":"Three","two":"Two"}
* Connection #0 to host 52.230.217.40 left intact
root@LinuxDebugging:/home/sribs/CamelApp/docker/golang#