OceanScript is an Esoteric language used to encode and decode text into a formulation of characters

Overview


OceanScript Esoteric Language
OceanScript Esoteric Language

Code Style: Black Imports: isort PRs welcome

Overview

OceanScript is an Esoteric language used to encode and decode text into a formulation of characters - where the final result looks like waves in the ocean.

Unlike it's prior versions, OceanScript supports any character, as well as capitalization. Your encoded string should be decoded to look exactly the same as the encoded string. Note, however, that outlying whitespace characters are stripped from the edges of the text.

How does it work?

OceanScript isn't just random choice or a random jumble of characters. These characters have very specific meanings, which once understood, can be used to write oceanscript without the use of the encoder. Take a look at these 4 tables below:

< - >
^ a b c .
~ d e f .
_ g h i .
< - >
^ j k l ..
~ m n o ..
_ p q r ..
< - >
^ s t u ...
~ v w x ...
_ y z 0 ...
< - >
^ 1 2 3 ....
~ 4 5 6 ....
_ 7 8 9 ....
< - >

When typing a character, you need to check the following in order:

  • What row is my character in? (The rows are denoted by the following characters: ^, ~, _.)
  • What column is my character in? (The columns are denoted by the following indicators: <, -, >.)
  • What box is my character in? (The boxes are denoted by ., multipled by n, where n is the box number. There are 4 boxes.)

Our final product will be known as a "wave". It will contain from 3 to 6 characters. Have a look at some examples below to understand how to write these waves.

Exemplar a

Here is an example of typing the character a. It is the easiest character to type from memory, and is great to use as a first example. Lets zoom in on a's box below:

< - >
^ a b c .
~ d e f .
_ g h i .
< - >

Using the table above, the character a is in the top row of it's box, so our first character is ^. Next, you need to check the column. a is also in the first column, so our second character is < (pointing to the left). Finally, we need to check which box character a is in. We will add . according to the table above. The number of dots corresponds to the box number (1-4).

a in oceanscript is ^<..

Exemplar x

Here is an example of typing the character x. Lets zoom in on x's box below:

< - >
^ s t u ...
~ v w x ...
_ y z 0 ...
< - >

Using the table above, the character x is in the second row of it's box, so our first character is ~. Next, you need to check the column. x is in the right-hand column, so our second character is > (pointing to the right). Finally, we need to check which box character x is in. We will add ..., because this is box 3 of 4.

x in oceanscript is ~>....

Joining waves

Wave is the name used for a single encoded character (z -> _-...). Waves can be freely joined together. Remember that every character ends with ., so you can easily work out where each wave ends.

  • hello -> _-.~-.^>..^>..~>..
  • foobar -> ~>.~>..~>..^-.^<._>..

Joining tides

Tide is the name used for a collection of "waves", so essentially a word converted into oceanscript. For example, _-.~-.^>..^>..~>.. is a tide, meaning "hello". Tides can be joined using either commas, or line breaks. For pretty formatting, or if you have a lot of text, you should use line breaks - but otherwise go with commas.

  • hello foobar -> _-.~-.^>..^>..~>..,~>.~>..~>..^-.^<._>.. (notice the comma separating these two waves)

OR...

  • hello foobar ->

    _-.~-.^>..^>..~>..

    ~>.~>..~>..^-.^<._>..

Special characters

Don't fear, oceanscript isn't just limited to a-z and 0-9. Well, it used to be - but a new special character indicator has been added to support any other character.

It is best to keep these special characters out of the ocean, so these characters will need to use a raft (=). Simply put the raft before the character. If you wanted to write the Greek lambda character (λ), it will need a raft seeing as its not in the large table, so it would simply be written as . More common characters (., !, ?) are more likely to appear, they will need rafts too.

  • ? -> =?
  • ^ -> =^
  • ... -> =.=.=.

Despite not appearing in the table, capitalized a-z characters DO NOT need to use rafts. See below about capitalization.

Capitalization

Capitalization hadn't been supported for months proceeding the initial release of oceanscript, but its now available. To make a character capital, use a splash (*) before the wave.

  • a -> ^<.
  • A -> *<.

For each capital wave you have, you will have to add a splash before each one. Yes, these waves are choppy...

  • hello -> _-.~-.^>..^>..~>..
  • HELLO -> *_-.*~-.*^>..*^>..*~>..

Note that you should not use splashes for numeric characters, or any characters that are not alphabetic. This is because these characters do not have case forms (and therefore don't produce splashes! You could call them subtle waves...)

Line breaks

For line breaks in oceanscript, use %. For example, presenting an acronym:

N
A
S
A

In oceanscript, the above acronym would be encoded into *~-..%*^<.%*^<...%*^<..

All identifiers

Identifier Description
, Represents a space
\n Represents a space
% Represents a line break
= Creates a raft for a single character (proceeding character will be ignored by encoder)
* Creates a splash for a wave (proceeding wave will be capitalized)
^ Denotes the top row of a box for a single wave.
~ Denotes the middle row of a box for a single wave.
_ Denotes the bottom row of a box for a single wave.
< Denotes the left-handed column of a box for a single wave.
- Denotes the central column of a box for a single wave.
> Denotes the right-handed column of a box for a single wave.
. Denotes the box number based on the count of ".".

Terminology glossary

Word Description Example
raft A character (=) used to prefix a special character (not a-Z or 0-9). =.
ripple A character that would make up a wave. Does not include =, * or %. ^
splash A character (*) used to capitalize the following wave. *_<.
tide A collection of waves to form a word, where the word is the tide. *_-.~-.^>..^>..~>..
wave A single character encoded into oceanscript. ^<..

Python Implementation

As a programmer, I just had to make a Python library for this. Once upon a time, it was all just a looming thought in my mind with so much potential. Its been great to be able to create a working usable program for it, for anyone to use and play around with.

Start by importing the module:

import oceanscript

Encoding into oceanscript

Use the oceanscript.encode method. This method also takes an optional keyword-only argument "mode", which decides whether the encoder uses commas or line breaks to replace spaces. Specify stretch for line breaks, or squash for commas. Defaults to squash.

..^>..~>..' >>> oceanscript.encode("Hello world!") '*_-.~-.^>..^>..~>..,~-...~>.._>..^>..~<.=!' >>> oceanscript.encode("Hello world!", mode="stretch") '*_-.~-.^>..^>..~>..' '~-...~>.._>..^>..~<.=!'">
>>> oceanscript.encode("hello")
'_-.~-.^>..^>..~>..'

>>> oceanscript.encode("Hello world!")
'*_-.~-.^>..^>..~>..,~-...~>.._>..^>..~<.=!'

>>> oceanscript.encode("Hello world!", mode="stretch")
'*_-.~-.^>..^>..~>..'
'~-...~>.._>..^>..~<.=!'

Decoding from oceanscript

Use the oceanscript.decode method. Both modes from the encode method are compatible with decoding (you don't have to specify a mode here).

..^>..~>..") 'hello' >>> oceanscript.decode("*_-.~-.^>..^>..~>..,~-...~>.._>..^>..~<.=!") 'Hello world!' >>> text = """ *_-.~-.^>..^>..~>.. ~-...~>.._>..^>..~<.=! """ >>> oceanscript.decode(text) 'Hello world!'">
>>> oceanscript.decode("_-.~-.^>..^>..~>..")
'hello'

>>> oceanscript.decode("*_-.~-.^>..^>..~>..,~-...~>.._>..^>..~<.=!")
'Hello world!'

>>> text = """
    *_-.~-.^>..^>..~>..
    ~-...~>.._>..^>..~<.=!
    """
>>> oceanscript.decode(text)
'Hello world!'

If the oceanscript doesn't look quite right, the parser won't like it. oceanscript.OceanScriptError is thrown, but the traceback details are fairly useful for correcting these mistakes.

OceanScriptError has a position attribute, which is the string index in where the exception was raised (at the start of the wave).

....") # capitalizing int OceanScriptError: Splash indicator not allowed for integers (position 0) >>> oceanscript.decode("=a") # rafting ascii value OceanScriptError: Do not use lowercase ascii letters or digits on a raft ('=a'). Use '^<.' instead. (position 0) >>> oceanscript.decode("^-.~>..#>..") # invalid row indicator '#' OceanScriptError: '#' is not a valid row indicator (position 7) >>> oceanscript.decode("^+...") # invalid column indicator '+' OceanScriptError: '^' indicator expected '<', '-', or '>', but received '+' instead (position 0)">
>>> oceanscript.decode("*>....") # capitalizing int
OceanScriptError: Splash indicator not allowed for integers (position 0)

>>> oceanscript.decode("=a") # rafting ascii value
OceanScriptError: Do not use lowercase ascii letters or digits on a raft ('=a'). Use '^<.' instead. (position 0)

>>> oceanscript.decode("^-.~>..#>..") # invalid row indicator '#'
OceanScriptError: '#' is not a valid row indicator (position 7)

>>> oceanscript.decode("^+...") # invalid column indicator '+'
OceanScriptError: '^' indicator expected '<', '-', or '>', but received '+' instead (position 0)

Other tracebacks can appear, too.

Installation

Install from the recommended package installer, pip.

pip install oceanscript

License

Licensed under MIT.

You might also like...
This repository contains data used in the NAACL 2021 Paper - Proteno: Text Normalization with Limited Data for Fast Deployment in Text to Speech Systems

Proteno This is the data release associated with the corresponding NAACL 2021 Paper - Proteno: Text Normalization with Limited Data for Fast Deploymen

Kashgari is a production-level NLP Transfer learning framework built on top of tf.keras for text-labeling and text-classification, includes Word2Vec, BERT, and GPT2 Language Embedding.

Kashgari Overview | Performance | Installation | Documentation | Contributing 🎉 🎉 🎉 We released the 2.0.0 version with TF2 Support. 🎉 🎉 🎉 If you

Kashgari is a production-level NLP Transfer learning framework built on top of tf.keras for text-labeling and text-classification, includes Word2Vec, BERT, and GPT2 Language Embedding.

Kashgari Overview | Performance | Installation | Documentation | Contributing 🎉 🎉 🎉 We released the 2.0.0 version with TF2 Support. 🎉 🎉 🎉 If you

Text-Summarization-using-NLP - Text Summarization using NLP  to fetch BBC News Article and summarize its text and also it includes custom article Summarization Converts text into a PDF of handwritten notes
Converts text into a PDF of handwritten notes

Text To Handwritten Notes Converts text into a PDF of handwritten notes Explore the docs » · Report Bug · Request Feature · Steps: $ git clone https:/

DomainWordsDict, Chinese words dict that contains more than 68 domains, which can be used as text classification、knowledge enhance task

DomainWordsDict, Chinese words dict that contains more than 68 domains, which can be used as text classification、knowledge enhance task。涵盖68个领域、共计916万词的专业词典知识库,可用于文本分类、知识增强、领域词汇库扩充等自然语言处理应用。

Question answering app is used to answer for a user given question from user given text.
Question answering app is used to answer for a user given question from user given text.

Question answering app is used to answer for a user given question from user given text.It is created using HuggingFace's transformer pipeline and streamlit python packages.

Simple Python script to scrape youtube channles of "Parity Technologies and Web3 Foundation" and translate them to well-known braille language or any language

Simple Python script to scrape youtube channles of "Parity Technologies and Web3 Foundation" and translate them to well-known braille language or any

Comments
  • Add support for BOX-4 truncation

    Add support for BOX-4 truncation

    I am making a proposal to allow truncation of BOX-4 characters (1-9) to nullify the distorted/stretched waves produced when chaining integers together in a tide.

    There are various ideas within this proposal, but I'm fairly settled with idea 1.

    Idea 1

    This idea postulates the use of the lower-case letter o to replace the use of .....

    Previously 123456789 -> ^<....^-....^>....~<....~-....~>...._<...._-...._>....

    With proposal 123456789 -> ^<o^-o^>o~<o~-o~>o_<o_-o_>o

    Proposal Advantages

    • The shape of the letter "o" resembles bubbles, or even fish mouths open. This adheres to the theme created through oceanscript.
    • It truncates the encoded string by almost 50%.
    • It makes large numbers, such as phone numbers, look more presentable.
    • It really suits the characters around it well, so that the "o"'s do not look out of place.

    Proposal Disadvantages

    • Migration.

    Idea 2

    This idea postulates the use of the degree symbol (°) to replace the use of .....

    Previously 123456789 -> ^<....^-....^>....~<....~-....~>...._<...._-...._>....

    With proposal 123456789 -> ^<°^-°^>°~<°~-°~>°_<°_-°_>°

    Proposal Advantages

    • The shape of the "°" resembles bubbles, floating upwards. This adheres to the theme created through oceanscript.
    • The degrees symbol reinstantiates the diversity in the multitude of identifier heights used.
    • It truncates the encoded string by almost 50%.
    • It makes large numbers, such as phone numbers, look more presentable.

    Proposal Disadvantages

    • Migration.
    • "°" not available across the majority of smartphone and PC keyboards worldwide. This is a major drawback especially due to the common use of numbers in our day to day lives.

    Idea 3

    This idea postulates the use of the colon character (:) to replace every occurance of 2 dots (..)

    Previously 123456789 -> ^<....^-....^>....~<....~-....~>...._<...._-...._>....

    With proposal 123456789 -> ^<::^-::^>::~<::~-::~>::_<::_-::_>::

    Proposal Advantages

    • The shape of the ":" partially resembles bubbles. This partially adheres to the theme created through oceanscript.
    • It truncates the encoded string by about 25%.
    • It makes large numbers, such as phone numbers, look better presentable.

    Proposal Disadvantages

    • Migration.
    • Only a partial adherence to oceanscript's theme. It starts to look "blocky" when multiple integers are lined up against each other.

    Summary

    Best appearance?

    • [ ] Idea 1
    • [x] Idea 2
    • [ ] Idea 3

    Best accessibility?

    • [x] Idea 1
    • [ ] Idea 2
    • [ ] Idea 3

    Easiest migration?

    • [x] Idea 1
    • [x] Idea 2
    • [ ] Idea 3

    Best adherence to theme?

    • [ ] Idea 1
    • [x] Idea 2
    • [ ] Idea 3

    Best truncation?

    • [x] Idea 1
    • [x] Idea 2
    • [ ] Idea 3

    Seeing as idea 3 does not qualify for any of these checks, it should be expunged from the list of ideas. Whilst idea 2 has 4 checks, idea 1 only has 3, falling 1 short. However, accessibility is a massive drawback for idea 2, meaning that idea 1 should probably pass through for only this reason.

    enhancement question 
    opened by Kreusada 1
Releases(v2.3.0)
  • v2.3.0(Feb 26, 2022)

    Ahhh, so much time went into this release.

    • Documentation for oceanscript is now available! https://oceanscript.readthedocs.io/en/latest/
    • .... is nearing deprecation. Use o instead. o will now take precedence by the encoder.
    Source code(tar.gz)
    Source code(zip)
  • v2.2.1(Feb 21, 2022)

    This releases fixes the decoder's traceback suggestion when decoding space character. The decoder previously recommended =, it will now recommend ,.

    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Feb 21, 2022)

    BREAKING CHANGE

    Text is no longer whitespace stripped by the encoder or decoder. Previously, encoding "\n" would return "", instead of "%". Other issues were also prominent.

    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Feb 21, 2022)

  • v2.1.2(Feb 19, 2022)

    This release fixes the splitwaves() function from omitting special one length identifiers from the returned tuple when the include_invalid kwarg is set to False. Also adds unit tests.

    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Feb 18, 2022)

  • v2.1.0(Feb 18, 2022)

    This release exposes splitwaves as a public method used to split waves in an oceanscript string. Additionally, tracebacks are now massively more precise, consistent, and more specific on the error caused when decoding.

    This release's hot points:

    • Enhanced traceback detail
    • New splitwaves() functionality
    • Splash indicator severity majorly increased
    • OceanScriptError.without_position_reference() functionality

    The following rules have been added to the splash indicator which may cause strings before v2.1.0 to break:

    • Splash indicators are now strictly not allowed to be prefixing non-alphabetic waves, and will raise an error post 2.1.0.
    • Splash redundancy is now evaluated and will raise an error when using the splash indicator for already capitalized alphabetic characters.

    Updates for error handling:

    • without_position_reference() method has been added for OceanScriptError to return OceanScriptError.__str__() without the position referenced prefixed at the beginning of the string.
    • The position kwarg is now Optional.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Feb 13, 2022)

  • v2.0.2(Feb 13, 2022)

    This release includes improvements to traceback specifications such as using "indicator" over "marker", as this common reference was later downturned in favor.

    Source code(tar.gz)
    Source code(zip)
Owner
Hola!
Utilizing RBERT model for KLUE Relation Extraction task

RBERT for Relation Extraction task for KLUE Project Description Relation Extraction task is one of the task of Korean Language Understanding Evaluatio

snoop2head 14 Nov 15, 2022
customer care chatbot made with Rasa Open Source.

Customer Care Bot Customer care bot for ecomm company which can solve faq and chitchat with users, can contact directly to team. 🛠 Features Basic E-c

Dishant Gandhi 23 Oct 27, 2022
Knowledge Graph,Question Answering System,基于知识图谱和向量检索的医疗诊断问答系统

Knowledge Graph,Question Answering System,基于知识图谱和向量检索的医疗诊断问答系统

wangle 823 Dec 28, 2022
A python package to fine-tune transformer-based models for named entity recognition (NER).

nerblackbox A python package to fine-tune transformer-based language models for named entity recognition (NER). Resources Source Code: https://github.

Felix Stollenwerk 13 Jul 30, 2022
Cherche (search in French) allows you to create a neural search pipeline using retrievers and pre-trained language models as rankers.

Cherche (search in French) allows you to create a neural search pipeline using retrievers and pre-trained language models as rankers. Cherche is meant to be used with small to medium sized corpora. C

Raphael Sourty 224 Nov 29, 2022
NLP command-line assistant powered by OpenAI

NLP command-line assistant powered by OpenAI

Axel 16 Dec 09, 2022
Tutorial to pretrain & fine-tune a 🤗 Flax T5 model on a TPUv3-8 with GCP

Pretrain and Fine-tune a T5 model with Flax on GCP This tutorial details how pretrain and fine-tune a FlaxT5 model from HuggingFace using a TPU VM ava

Gabriele Sarti 41 Nov 18, 2022
Coreference resolution for English, German and Polish, optimised for limited training data and easily extensible for further languages

Coreferee Author: Richard Paul Hudson, msg systems ag 1. Introduction 1.1 The basic idea 1.2 Getting started 1.2.1 English 1.2.2 German 1.2.3 Polish 1

msg systems ag 169 Dec 21, 2022
Twitter-Sentiment-Analysis - Analysis of twitter posts' positive and negative score.

Twitter-Sentiment-Analysis The hands-on project is in Python 3 Programming class offered by University of Michigan via Coursera. The task is to build

Eszter Pai 1 Jan 03, 2022
A Python script that compares files in directories

compare-files A Python script that compares files in different directories, this is similar to the command filecmp.cmp(f1, f2). I made this script in

Colvin 1 Oct 15, 2021
Summarization module based on KoBART

KoBART-summarization Install KoBART pip install git+https://github.com/SKT-AI/KoBART#egg=kobart Requirements pytorch==1.7.0 transformers==4.0.0 pytor

seujung hwan, Jung 148 Dec 28, 2022
Fixes mojibake and other glitches in Unicode text, after the fact.

ftfy: fixes text for you print(fix_encoding("(ง'⌣')ง")) (ง'⌣')ง Full documentation: https://ftfy.readthedocs.org Testimonials “My life is li

Luminoso Technologies, Inc. 3.4k Dec 29, 2022
LeBenchmark: a reproducible framework for assessing SSL from speech

LeBenchmark: a reproducible framework for assessing SSL from speech

11 Nov 30, 2022
Named-entity recognition using neural networks. Easy-to-use and state-of-the-art results.

NeuroNER NeuroNER is a program that performs named-entity recognition (NER). Website: neuroner.com. This page gives step-by-step instructions to insta

Franck Dernoncourt 1.6k Dec 27, 2022
Application for shadowing Chinese.

chinese-shadowing Simple APP for shadowing chinese. With this application, it is very easy to record yourself, play the sound recorded and listen to s

Thomas Hirtz 5 Sep 06, 2022
Official Stanford NLP Python Library for Many Human Languages

Official Stanford NLP Python Library for Many Human Languages

Stanford NLP 6.4k Jan 02, 2023
用Resnet101+GPT搭建一个玩王者荣耀的AI

基于pytorch框架用resnet101加GPT搭建AI玩王者荣耀 本源码模型主要用了SamLynnEvans Transformer 的源码的解码部分。以及pytorch自带的预训练模型"resnet101-5d3b4d8f.pth"

冯泉荔 2.2k Jan 03, 2023
COVID-19 Related NLP Papers

COVID-19 outbreak has become a global pandemic. NLP researchers are fighting the epidemic in their own way.

xcfeng 28 Oct 30, 2022
Implementation of legal QA system based on SentenceKoBART

LegalQA using SentenceKoBART Implementation of legal QA system based on SentenceKoBART How to train SentenceKoBART Based on Neural Search Engine Jina

Heewon Jeon(gogamza) 75 Dec 27, 2022
A PyTorch implementation of the Transformer model in "Attention is All You Need".

Attention is all you need: A Pytorch Implementation This is a PyTorch implementation of the Transformer model in "Attention is All You Need" (Ashish V

Yu-Hsiang Huang 7.1k Jan 05, 2023