Code Monkey home page Code Monkey logo

Comments (2)

rawsyntax avatar rawsyntax commented on May 20, 2024 1

@yaacov thanks! 🙏

from tree-search-language.

yaacov avatar yaacov commented on May 20, 2024

Hi, thanks for the issue ❤️

TSL language definition and implementations:

So TSL has two sets of string operators for "like":

1 - The SQL like:
https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L33
https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L34

2 - The NoSQL regexp:
RegexOp: https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L31

I did not implement all the operator in all the walkers ... , for example the SQL implementation did not implement the regexp operator, while the mongo one will skip the like.

tsl_mem

./tsl-mem example use the semantic walker to implement an in memory database:
https://github.com/yaacov/tree-search-language/blob/master/cmd/tsl_mem/main.go#L31

Semantic Walker

When giving semantic meaning to the operators in semantic pkg ( https://godoc.org/github.com/yaacov/tree-search-language/pkg/walkers/semantics ) I only implemented the Regexp operator:

In the function that handle string operators:
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L192
I only implemented:
RegExp:
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L212

And like falls into unexpected literal here:
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L226


P.S.

This will also happen in the mongo walker:
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/mongo/walk.go#L79
That only implement Regexp:
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/mongo/walk.go#L110

But not in the SQL walker 😄 :
https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/sql/walk.go#L139

from tree-search-language.

Related Issues (4)

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.