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!
Snips Python library to extract meaning from text

Snips NLU Snips NLU (Natural Language Understanding) is a Python library that allows to extract structured information from sentences written in natur

Snips 3.7k Dec 30, 2022
LSTM model - IMDB review sentiment analysis

NLP - Movie review sentiment analysis The colab notebook contains the code for building a LSTM Recurrent Neural Network that gives 87-88% accuracy on

Sundeep Bhimireddy 1 Jan 29, 2022
KoBART model on huggingface transformers

KoBART-Transformers SKT에서 공개한 KoBART를 편리하게 사용할 수 있게 transformers로 포팅하였습니다. Install (Optional) BartModel과 PreTrainedTokenizerFast를 이용하면 설치하실 필요 없습니다. p

Hyunwoong Ko 58 Dec 07, 2022
Optimal Transport Tools (OTT), A toolbox for all things Wasserstein.

Optimal Transport Tools (OTT), A toolbox for all things Wasserstein. See full documentation for detailed info on the toolbox. The goal of OTT is to pr

OTT-JAX 255 Dec 26, 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
A Multilingual Latent Dirichlet Allocation (LDA) Pipeline with Stop Words Removal, n-gram features, and Inverse Stemming, in Python.

Multilingual Latent Dirichlet Allocation (LDA) Pipeline This project is for text clustering using the Latent Dirichlet Allocation (LDA) algorithm. It

Artifici Online Services inc. 74 Oct 07, 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
Train 🤗transformers with DeepSpeed: ZeRO-2, ZeRO-3

Fork from https://github.com/huggingface/transformers/tree/86d5fb0b360e68de46d40265e7c707fe68c8015b/examples/pytorch/language-modeling at 2021.05.17.

Junbum Lee 12 Oct 26, 2022
The Sudachi synonym dictionary in Solar format.

solr-sudachi-synonyms The Sudachi synonym dictionary in Solar format. Summary Run a script that checks for updates to the Sudachi dictionary every hou

Karibash 3 Aug 19, 2022
A fast and easy implementation of Transformer with PyTorch.

FasySeq FasySeq is a shorthand as a Fast and easy sequential modeling toolkit. It aims to provide a seq2seq model to researchers and developers, which

宁羽 7 Jul 18, 2022
BARTpho: Pre-trained Sequence-to-Sequence Models for Vietnamese

Table of contents Introduction Using BARTpho with fairseq Using BARTpho with transformers Notes BARTpho: Pre-trained Sequence-to-Sequence Models for V

VinAI Research 58 Dec 23, 2022
An ActivityWatch watcher to pose questions to the user and record her answers.

aw-watcher-ask An ActivityWatch watcher to pose questions to the user and record her answers. This watcher uses Zenity to present dialog boxes to the

Bernardo Chrispim Baron 33 Dec 03, 2022
GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model

GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model -- based on GPT-3, called GPT-Codex -- that is fine-tuned on publicly available code from GitHub.

Nathan Cooper 2.3k Jan 01, 2023
Code for using and evaluating SpanBERT.

SpanBERT This repository contains code and models for the paper: SpanBERT: Improving Pre-training by Representing and Predicting Spans. If you prefer

Meta Research 798 Dec 30, 2022
Share constant definitions between programming languages and make your constants constant again

Introduction Reconstant lets you share constant and enum definitions between programming languages. Constants are defined in a yaml file and converted

Natan Yellin 47 Sep 10, 2022
Retraining OpenAI's GPT-2 on Discord Chats

Train OpenAI's GPT-2 on Discord Chats Retraining a Text Generation Model on Discord Chats using gpt-2-simple that wraps existing model fine-tuning and

Ayush Mishra 4 Oct 27, 2022
To create a deep learning model which can explain the content of an image in the form of speech through caption generation with attention mechanism on Flickr8K dataset.

To create a deep learning model which can explain the content of an image in the form of speech through caption generation with attention mechanism on Flickr8K dataset.

Ragesh Hajela 0 Feb 08, 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
FewCLUE: 为中文NLP定制的小样本学习测评基准

FewCLUE: 为中文NLP定制的小样本学习测评基准

CLUE benchmark 387 Jan 04, 2023
Final Project for the Intel AI Readiness Boot Camp NLP (Jan)

NLP Boot Camp (Jan) Synopsis Full Name: Prameya Mohanty Name of your School: Delhi Public School, Rourkela Class: VIII Title of the Project: iTransect

TheCodingHub 1 Feb 01, 2022