eros-client: A command-line interface to the eros library.

[ bsd3, program, text ] [ Propose Tags ]

This is a command-line interface to the eros library. It is terrible at the moment, and will be deprecated before version 0.5.0.0, so it isn't a huge priority.


[Skip to Readme]
Versions [faq] 0.4.0.0, 0.5.0.0, 0.5.0.1
Dependencies aeson, aeson-pretty, base (==4.7.*), bytestring, containers, eros (==0.4.0.0), text [details]
License BSD-3-Clause
Copyright 2014, Peter Harpending.
Author Peter Harpending
Maintainer Peter Harpending <pharpend2@gmail.com>
Category Text
Source repo head: git clone https://github.com/pharpend/eros-client.git -b master
Uploaded by pharpend at 2014-06-30T10:22:29Z
Distributions NixOS:0.5.0.1
Executables erosc
Downloads 2166 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Last success reported on 2015-05-27 [all 6 reports]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for eros-client-0.4.0.0

[back to package description]

eros-client

This is a command line interface to the eros library.

Usage - v.0.4.0.0

This is a usage guide for version 0.4.0.0. There will be more up-to-date usage guides as more versions come, hopefully.

To install, run cabal install eros-client-0.4.0.0.

The only way to interact with the library, for the time being is through the client I built, erosc. It accepts input in Javascript Object Notation (JSON) through stdin.

Here is the schema for the input:

{
  "name": "erosc-input",
  "type": "object",
  "description": "The schema for the input to erosc.",
  "properties": {
    "text": {
      "type": "string",
      "description": "The text you want to be checked against the phraselists.",
      "required": true
    },
    "eros-lists": {
      "type": "array",
      "description": "The phraselists provided by eros you want \"text\" to be checked against.",
      "required": true,
      "items": {
        "type": "string"
      }
    },
  }
}

That is the up-to-date schema, as of version 0.4.0.0 . It is liable to change. If the version you downloaded is greater than 0.4.0.0, make sure to check the schema (it is distributed with the package) to make sure it is up to date. The schema is located in res/schemata/erosc-input.json.

erosc will take that input, and send back output in JSON, in accordance with the schema found in res/schemata/erosc-output.json.

{
  "name": "erosc-output",
  "type": "array",
  "description": "The output of erosc.",
  "items": {
    "type": "object",
    "description": "The phraselist name, along with the score for that phraselist.",
    "properties": {
      "eros-list": {
        "type": "string",
        "description": "The name of the phraselist corresponding to this object."
      },
      "score": {
        "type": "number",
        "description": "The score corresponding to this phraselist."
      }
    }
  }
}

Example

This is the example input from res/erosc-dummy-inputs/input0.json.

{
  "text": "Fuck you, you fucking fuck! Fucking bitch tits milf sex sluts!",
  "eros-lists": [
    "gambling",
    "pornography"
  ]
}

Running erosc < res/erosc-dummy-inputs/input0.json yields

[
  {
    "score": 0,
    "eros-list": "gambling"
  },
  {
    "score": 11394,
    "eros-list": "pornography"
  }
]

Contributing

I would love if people would contribute. This client is BSD-licensed, so you can pretty much do whatever you want with it.

If you have any ideas, don't hesitate to contact me.

Planned features

erosceros-server

As it stands, erosc is tedious and a bit difficult to use. I plan on rewriting erosc to act as an HTTP[s] server, using Happstack, using acid-state as a RAM cloud. This will be the fastest and easiest to maintain solution.

I will still include an offline client, but it won't be the focus of development.

More options

I need to add more filtering options, such as phraselist-specific thresholds, custom phraselists, and, well, just more stuff.

Contact

The best way to contact me is via IRC. I hang out a lot on #archlinux and #haskell on the FreeNode network. My nicks are l0cust and isomorpheous.

You can also email me at pharpend2@gmail.com, although I'm not great at checking that email address.