Skip to content

Instantly share code, notes, and snippets.

View zareshahi's full-sized avatar
🏠
https://GhadirAI.com

Ali Zare Shahi zareshahi

🏠
https://GhadirAI.com
View GitHub Profile
@zareshahi
zareshahi / streamer.py
Created October 28, 2020 12:10 — forked from vessaldaneshvar/streamer.py
Get data from API Twitter and using for Data Analysis
from neo4j import GraphDatabase
import tweepy
import json
# Connect To DataBase Neo4j
uri = "bolt://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "twitterdata"))
consumer_key = "consumer_key"
consumer_secret = "consumer_secret"
access_token = "access_token"
@zareshahi
zareshahi / compare-strings.py
Created October 11, 2021 07:32 — forked from arastu/compare-strings.py
Jaccard algorithms for comparing two strings and return similarity score, Port and refactor https://github.com/aceakash/string-similarity to python
def ngram_string(string, n=3, remove_space=False):
if remove_space:
string = string.replace(' ', '')
if len(string) < n:
return {string: 1}
ngrams = dict()
for i in range(len(string)-n+1):
ngram = string[i:i+n]