Skip to content

Instantly share code, notes, and snippets.

View amirouche's full-sized avatar

Amir Amazigh BOUBEKKI amirouche

View GitHub Profile
@amirouche
amirouche / avsl-nutshell.txt
Created June 22, 2021 12:00 — forked from johnwcowan/avsl-nutshell.txt
AVSL (A Very {Simple|Small|Safe} Language) in a nutshell
Goals:
Easy to learn and use by beginning programmers
Easy to relearn and use by "perpetual intermediate" programmers
Suitable for use as a front-end language (not in a browser)
Not infuriating to advanced programmers
Case insensitive (except strings)
Everything should be as simple as possible but no simpler
High-level design choices:
Mostly intended for easy UI programming
# BM25F Model
def bm25(idf, tf, fl, avgfl, B, K1):
# idf - inverse document frequency
# tf - term frequency in the current document
# fl - field length in the current document
# avgfl - average field length across documents in collection
# B, K1 - free paramters
return idf * ((tf * (K1 + 1)) / (tf + K1 * (1 - B + B * (fl / avgfl))))