Code Monkey home page Code Monkey logo

rubyfca's Introduction

๐Ÿ’ญ RubyFCA

Command line tool for Formal Concept Analysis (FCA) written in Ruby.

Change Log

  • More test cases added [June 19, 2023]
  • Microsoft Excel .xlsx files supported [June 18, 2023]

Features

  • Converts data in XLSX (Microsoft Excel), CSV (comma-separated values), or CXT (Conexp) and generate a Graphviz DOT file, a SVG/EPS vector image file, or /a PNG/JPG bitmap file.
  • Adopts the Ganter algorithm (with reference to its Perl implementation of Fcastone by Uta Priss).

Dependencies

To install Graphviz using Homebrew on MacOS, for example, execute the following command:

brew install graphviz

For installation instructions for other platforms, see the Graphviz download page.

Installation

Install the gem:

gem install rubyfca

How to Use

RubuFCA converts Conexp CXT data to Graphviz dot format.

Usage:
       rubyfca [options] <source file> <output file>

where:
<source file>
       ".xlsx", ".csv" ,".cxt"
<output file>
       ".svg", ".png", ".jpg", ".eps", or ".dot"
[options]:
          --full, -f:   Do not contract concept labels
  --coloring, -c <i>:   Color concept nodes [0 = none (default), 1 =
                        lightblue/pink, 2 = monochrome] (default: 0)
      --straight, -s:   Straighten edges (available when output format is
                        either png, jpg, svg, pdf, or eps)
   --nodesep, -n <f>:   Size of separation between sister nodes (from 0.1 to
                        5.0) (default: 0.4)
   --ranksep, -r <f>:   Size of separation between ranks (from 0.1 to 5.0)
                        (default: 0.2)
        --legend, -l:   Print the legend of concept nodes (available only when
                        using circle node shape)
        --circle, -i:   Use circle shaped concept nodes
       --version, -v:   Print version and exit
          --help, -h:   Show this message

Examples

Input Data

XLSX (Excel)

CSV

        , Ostrich , Sparrow , Eagle , Lion , Bonobo , Human being
bird    , X       , X       , X     ,      ,        ,  
mammal  ,         ,         ,       , X    , X      , X
ape     ,         ,         ,       ,      , X      , X
flying  ,         , X       , X     ,      ,        ,  
preying ,         ,         , X     , X    ,        ,  
talking ,         ,         ,       ,      ,        , X

CXT

B

6
6

Ostrich
Sparrow
Eagle
Lion
Bonobo
Human being
bird
mammal
ape
flying
preying
talking
XXX...
...XXX
....XX
.XX...
..XX..
.....X

Output

rubyfca input_file output_file --coloring 1 --full --nodesep 0.8 --ranksep 0.3 --straight

rubyfca input_file output_file --coloring 2 --nodesep 0.5 --ranksep 0.3

rubyfca input_file output_file --circle --legend --coloring 1 --full --nodesep 0.8 --ranksep 0.3 --straight

N.B. The arrangement of elements in the right-hand side of the image above has been a little modified for better visibility.

Miscellaneous

RGB Color Model

Natural numbers

References

Yoichiro Hasebe and Kow Kuroda. 2009. Extraction of English Ditransitive Constructions Using Formal Concept Analysis. In Proceedings of the 23rd Pacific Asia Conference on Language, Information and Computation, Volume 2, pages 678โ€“685, Hong Kong. City University of Hong Kong.

Authors

License

See LICENSE for details.

rubyfca's People

Contributors

yohasebe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.