Skip to content

Instantly share code, notes, and snippets.

View oderwat's full-sized avatar
💭
Go da Lang...

Hans Raaf oderwat

💭
Go da Lang...
View GitHub Profile
@oderwat
oderwat / Naivebayes.go
Created April 23, 2022 02:43 — forked from caongocthai/Naivebayes.go
Sentiment Analysis: Naive Bayes Classifier from scratch in Golang
package main
// The string values of the 2 classes
// They can be "positive" >< "negative" as in this example
// They can also be "ham" >< "spam", i.e.
const (
positive = "positive"
negative = "negative"
)
@oderwat
oderwat / Phone Words II.swift
Last active November 6, 2016 16:55 — forked from erica/Phone Words II.swift
Phone Words II for Swift 3.0.1
import Cocoa
// Missing isWord
func isWord(string: String) -> Bool {
if let _ = Int(string) { return false }
let range = NSSpellChecker.shared().checkSpelling(of: string, startingAt: 0)
return range.location == NSNotFound
}
/*:
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`