All Projects → tategakibunko → Typenovel

tategakibunko / Typenovel

Licence: other
A simple markup language to write novel with types.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Typenovel

Funbook Old
I have a dream, to be a novelist someday.
Stars: ✭ 65 (-18.75%)
Mutual labels:  novel, writing
Tiger
Tiger Compiler from "Modern Compiler Implementation in ML" by Andrew W. Appel
Stars: ✭ 77 (-3.75%)
Mutual labels:  compiler
Abigsurvey
A collection of 500+ survey papers on Natural Language Processing (NLP) and Machine Learning (ML)
Stars: ✭ 1,203 (+1403.75%)
Mutual labels:  natural-language-processing
Chinese Xlnet
Pre-Trained Chinese XLNet(中文XLNet预训练模型)
Stars: ✭ 1,213 (+1416.25%)
Mutual labels:  natural-language-processing
Article
Components for interactive scientific writing, reactive documents and explorable explanations.
Stars: ✭ 77 (-3.75%)
Mutual labels:  writing
Practical 3
Oxford Deep NLP 2017 course - Practical 3: Text Classification with RNNs
Stars: ✭ 78 (-2.5%)
Mutual labels:  natural-language-processing
Vab
V Android Bootstrapper
Stars: ✭ 77 (-3.75%)
Mutual labels:  compiler
Opennmt Tf
Neural machine translation and sequence learning using TensorFlow
Stars: ✭ 1,223 (+1428.75%)
Mutual labels:  natural-language-processing
Rubyx
RubyX compiles ruby to binary (in ruby), hoping to be that X times faster
Stars: ✭ 78 (-2.5%)
Mutual labels:  compiler
Hakuneko
Manga & Anime Downloader for Linux, Windows & MacOS
Stars: ✭ 1,203 (+1403.75%)
Mutual labels:  novel
Yapypy
Yet another Python Python
Stars: ✭ 77 (-3.75%)
Mutual labels:  compiler
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (-3.75%)
Mutual labels:  compiler
Pandoc Sidenote
Convert Pandoc Markdown-style footnotes into sidenotes
Stars: ✭ 78 (-2.5%)
Mutual labels:  writing
Markdownmonster
An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
Stars: ✭ 1,203 (+1403.75%)
Mutual labels:  writing
Deepmoji
State-of-the-art deep learning model for analyzing sentiment, emotion, sarcasm etc.
Stars: ✭ 1,215 (+1418.75%)
Mutual labels:  natural-language-processing
Dialogue Understanding
This repository contains PyTorch implementation for the baseline models from the paper Utterance-level Dialogue Understanding: An Empirical Study
Stars: ✭ 77 (-3.75%)
Mutual labels:  natural-language-processing
Multimodal Toolkit
Multimodal model for text and tabular data with HuggingFace transformers as building block for text data
Stars: ✭ 78 (-2.5%)
Mutual labels:  natural-language-processing
Text Dependency Parser
🏄 依存关系分析,NLP,自然语言处理
Stars: ✭ 78 (-2.5%)
Mutual labels:  natural-language-processing
Fennel
Lua Lisp Language
Stars: ✭ 1,225 (+1431.25%)
Mutual labels:  compiler
Ja.text8
Japanese text8 corpus for word embedding.
Stars: ✭ 79 (-1.25%)
Mutual labels:  natural-language-processing

TypeNovel

A simple markup language to write novel with types.

Example

This is what it looks like.

@scene({
  season:"winter"
}){
  Finally, $season("Xmas") has come!
}

Output is here.

<scene data-season="winter">
  Finally, <season>Xmas</season> has come!
</scene>

For more information, take a look at Cheatsheet.

Install

npm install -g typenovel

Then /usr/local/bin/tnc would be installed.

[[email protected]] tnc --version
1.0.4

Use compiler from your project

You can compile from source by Tnc.fromString.

import { Tnc } from 'typenovel';

const result = Tnc.fromString('@scene(){ foo }', {
  format: 'html', // or 'text'
  minify: false
});

console.error(result.errors);
console.log(result.output);

Or you can compile from file by Tnc.fromFile.

import { Tnc } from 'typenovel';

const result = Tnc.fromFile('sample.tn', {
  format: 'html',
  minify: false
});

console.error(result.errors);
console.log(result.output);

Reader Application

Reader application is available for TypeNovel(compiler included).

Take a look at TypeNovelReader.

Motivation

What is the difference between pro novelist and amature novelist?

I'm running a novel posting platform over recent decades, and I always thought about differences between pro and amature.

I think that amature novelist sometimes lack some context description in their story, especially tend to lack the time description.

To confirm this feeling, I measured the scores how many times they wrote time in their novel, and gave them quolity scores.

The formula is simple.

[Total count of time written sentence] * [Entropy of time written sentence] / [Total sentence count]

For example, score of "Mon"('門' in Japanese) written by 'Natsume Soukeki (1867-1916)' is like this.

histgram: [30, 24, 33, 21, 29, 29, 30, 24, 24, 17]
score: 0.221913(total sentence size = 3879, total time sentences = 261, entropy = 3.298082)

In this way, I measured the average scores of many writers in my platform.

Here is scores of amature writers.

user1: average score:0.055084
user2: average score:0.057143
user3: average score:0.020505
user4: average score:0.071971
user5: average score:0.045247
user6: average score:0.042603
user7: average score:0.086316
user8: average score:0.051926
user9: average score:0.089533

And here is scores of pro writers.

pro1: average score:0.120076, Arthur Conan Doyle
pro2: average score:0.210235, Anton Pavlovich Chekhov
pro3: average score:0.124371, James Augustine Aloysius Joyce
pro4: average score:0.101132, Feodor Dostoyevsky
pro5: average score:0.138546, Nomura Kodou(野村胡堂)
pro6: average score:0.153463, Mori Ougai(森鴎外)
pro7: average score:0.148902, Christian Andersen
pro8: average score:0.110636, Natsume Souseki(夏目漱石)
pro9: average score:0.118976, Nakajima Atsushi(中島敦)

Clearly pro scores around 0.1, but amature scores around 0.05, difference is not so small.

So I thought "How can we fill the differences between pro and amature?".

In other words, "Can we fill the diffecence using some kind of technology?".

My answer is "novel with type"

I think we can force all writers to fill enough information in their text, to use typing.

But what is the type of novel?

I think it's pair of constraint and annotation.

This is what it looks like.

// block level tag starts with '@'
@scene({
  season: "winter", // constraint 'season'
  time: "7:00AM" // constraint 'time'
}){
  // annotation tag starts with '$'.
  // annotated constraint 'time(7:00AM)' as 'morning'
  I woke up at the $time("morning"). // I woke up at the morning.

  // annotated constraint 'season(winter)' as 'Xmas'
  Finally $season("Xmas")!
}

In this example, we have two constraints(season as "winter" and time as "7:00AM") for this scene block.

So we have to annotate them by writing annotation tag.

And we annotated them by $time("morning") and $season("Xmas").

Now we annotated all constraints, let's compile this code!

[[email protected]]$ tnc sample.tn

And you get html output like this.

<scene data-season="winter" data-time="7:00AM">
  I woke up at the <time>morning</time>.
  "Finally <season>Xmas</season>!"
</scene>

This output is NLP(Natural Language Processing) or ML(Machine Leraning) friendly, so both platform and writers win!

Writers merit: quality of novel

Platform merit: quality of data

By the way, if we don't annotated our constraints, what happens?

Offcource, you'll get errors at the compilation time.

/Users/u1/sample.tn(line:1) 'season' is not annotated in this block!
/Users/u1/sample.tn(line:2) 'time' is not annotated in this block!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].