hooqtv / fished Goto Github PK
View Code? Open in Web Editor NEWFish answers from rules and facts
License: MIT License
Fish answers from rules and facts
License: MIT License
Currently caching parsed rules only cached as long as the rule has not been changed. It is better to treat each of the rule individually.
we can use help of LRU (https://github.com/hashicorp/golang-lru)
In current algorithm, fished will map rules to a index:
example if we have input : ["A", "B"] it will be transform into { "A": [1], "B": [1] } (assume only one rule and in index 1 in the rule arrays) at runtime if both "required parameters" are met the rule will fire. In this case because the rule is successfully verified for both of these inputs, it will be fired twice hence double execution.
Fine work boss @JonathanSudibya. Looking at the test, I think testing a more complex rule might illustrate the engine's capability even better. For example, a common scenario is testing a rule that contains calling an API. Here is such scenario:
{
"input": ["pokemon_name"],
"output": ["pokemon"],
"rule": "getPokemon(pokemon_name)",
"value": "???"
},
{
"input": ["pokemon"],
"output": ["isGoodPokemon"],
"rule": "['dragon', 'fairy'].includes(pokemon.type)",
"value": "true"
}
From the above sample, some questions arose:
We need to have functionality of managing multiple results from an expression.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.