Code Monkey home page Code Monkey logo

json-similarity's Introduction

JSON Object Similarity Score

Website https://json-similarity.herokuapp.com/ made with rails BuiltBy made with javascript BuiltBy MIT license

This Repo aims at calculating the similarity score of two valid json objects. The Score varies from 0 to 1.0 being non-similar and 1 being fully identical.


How Scoring Algorithm Works?

  • The overall program expects two json objects as an input.
  • Each and Every key/value pairs of both the json inputs are compared to one another. The logic is to traverse through one of the Hash and finding the same key value in the other Hash. Cases:

    • If the key/value is present in both
      • Their is an equality check and on the basis of that equality global counters for truthy and falsy values are increamented.
    • If key/value is missing in one
      • In this case the key/value for the missing one is set as empty hash {} and then the same check is done as former.
  • It traverse through the complete json and then finally Counters are captured for truthy and falsy values.

  • Finally, Score is Calculated using: Truthy / Truthy + Falsy

NOTE: The score value is returned from range 0 - 1 .0being completely non-identical and1` being completely identical.


Steps to Run the project locally:

* Clone the repo: https://github.com/1akshat/json-similarity.git
* Navigate to the respective directory:
    cd json-similarity/
* Install all the dependencies.
    Run: bundle install
* Start The Server.
    RUN: rails s
* Visit: http://localhost:3000

Preview

alt text

Website Link

https://json-similarity.herokuapp.com/

json-similarity's People

Contributors

akshatinsync avatar

Watchers

James Cloos avatar

json-similarity's Issues

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.