michen00 / kern

Unix kernel for software 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kern

Unix kernel for Software 2.0

image

from kern import image

image.to_text('files/cats.jpg')
'a cat laying on a blanket next to a cat laying on a bed'
cat files/cats.jpg | image
a cat laying on a blanket next to a cat laying on a bed

image and text

from kern import image

image.and_text_to_text('files/cats.jpg', "How many cats?")
'2'

image.and_text_to_text('files/cats.jpg', "How many dogs?")
'0'

image.and_text_to_text('files/cats.jpg', "What animal is this?")
'cat'

image.and_text_to_text('files/cats.jpg', "What animals are these?")
'cats'
cat files/cats.jpg | image "How many cats?"
2

cat files/cats.jpg | image "How many dogs?"
0

cat files/cats.jpg | image "What animal is this?"
cat

cat files/cats.jpg | image "What animals are these?"
cats

pdf

from kern import pdf
file = "files/chicken.pdf"
text = pdf.to_text(file)
text.count('chicken')
1267
cat files/chicken.pdf | pdf | head -1
Chicken Chicken Chicken: Chicken Chicken

html

from kern import html
page = "<html><h1><b>Hello,</b></h1><h2><i> world</i></h2></html>"
html.to_text(page)
Hello, world
echo "<html><h1><b>Hello,</b></h1><h2><i> world</i></h2></html>" | html
Hello, world

About

Unix kernel for software 2.0


Languages

Language:Python 93.6%Language:Makefile 6.4%