Schenglish

Schenglish

schenglish (scheduling english) is a domain specific language for scheduling the timing of events. It is a subset of English that can do only one thing: calculate the temporal relationship of events to a timeline, or to other events. Schenglish is written in short, simple, non-compound sentences. Its parser can interpret all English tenses, meaning that complex tense-based temporal relations can be represented, such as:

Event3 will have finished 3 seconds after Event2 has been playing for 12 seconds.

The idea behind the language is to explore the advantages of representing the idiosyncratic approaches to time often found in natural languages.

It uses a PEG (Parsing Expression Grammar) to transform the text into an array of events. This is achieved using the library peg.js.

Syntax Guide

subjects and objects (events)

An event can have any one-word name consisting of letters or numbers. schenglish will automatically work out which words are events based upon context. EVENT1 could be an event, but so could DavidIsSoC00L.

Each sentence needs to be a single phrase. Sentences cannot be joined using connectives such as "and" or "but": EVENT1 starts when EVENT2 stops. will parse but At 3 seconds, EVENT1 starts and EVENT2 stops. will not.

Each sentence needs to consist of a subject, and can also consist of an object. An example of a sentence with a subject and an object is: EVENT1 starts playing 5 seconds after EVENT2 has ended. Where an object is not specified, the sentence should make reference to the timeline using at, as in: EVENT1 starts playing at 5 seconds..

Schenglish is designed for calculating the starting and ending of events, and each subject or object needs to use one of the following primary verbs within a sentence: start, stop, play, begin, end and finish. Auxiliary verbs suchas have, be, will and shall can be used to specify tense, but need to be accompanied by a primary verb in order to work: At 12 seconds, EVENT1 will have started playing. will parse but EVENT1 is at 12 seconds. will not.

EVENTs can refer to themselves within the same sentence using it. For example: EVENT1 ends 5 seconds after it started. However, this will not work when referring to an event that is not within the same sentence.

time

Time can be represented using numerals and decimal places followed by a unit, which can be ms, seconds, minutes and hours: e.g. 7.2 seconds. Different time units can be specified by separating them with commas or the word and: EVENT2 starts playing 1 minute, 2 seconds and 500 ms after EVENT1 starts.

There is no built-in way for specifying the beginning and end of the piece of time you are working within. This might prove problematic if you want to place events in relationship to it. An idiomatic approach might involve defining the duration of the work as an event in itself:

Work starts at 0 seconds. Work ends at 30 seconds. Note starts at 2 seconds. Note ends when Work ends.

verbs: primary

  • start, starts, started, starting
  • stop, stops, stopped, stopping
  • play, plays, played, playing
  • begin, begins, begun, began, beginning
  • finish, finishes, finished, finishing
  • end, ends, ended, ending

verbs: auxiliary

  • is, was, been, be
  • have, has, had, having
  • will, shall

tenses

tenseexample
past perfectEVENT1 had started
simple pastEVENT1 played
present perfectEVENT1 has played
presentEVENT1 plays
simple futureEVENT1 will play
future perfectEVENT1 will have played
past perfect extendedEVENT1 had been playing
simple past extendedEVENT1 was playing / EVENT1 started playing
present perfect extendedEVENT1 has been playing / EVENT1 has started playing
present extendedEVENT1 is playing / EVENT1 starts playing
simple future extendedEVENT1 will be playing / EVENT1 will start playing
future perfect extendedEVENT1 will have been playing
imperativePlay EVENT1

relations

at

at should be used to reference the timeline: At 3 seconds, start EVENT1.

before, after, when

before, after and when is used to reference the time of another event:

  • EVENT1 starts 3 seconds before EVENT2 finishes.
  • EVENT1 starts 3 seconds after EVENT2 finishes.
  • EVENT1 starts when EVENT2 finishes.

for

  • for is used to indicate duration or temporal position based on context:
  • At 3 seconds, EVENT1 had been playing for 5 seconds.
  • At 3 seconds EVENT1 plays for 5 seconds.

sentence construction

constructionexample
subject verb relation timeEVENT1 started playing at 2 minutes.
verb subject relation timeStart playing EVENT1 at 2 minutes.
relation time subject verbAt 2 minutes, EVENT1 will have started playing.
relation time verb subjectAt 2 minutes, start playing EVENT1.
subject verb relation object verbEVENT1 starts playing when EVENT2 finishes.
verb subject relation object verbStart playing EVENT1 when EVENT2 finishes.
subject verb time relation object verbEVENT1 starts playing 3 seconds before EVENT2 finishes.
time relation object verb subject verb3 seconds before EVENT2 finishes, EVENT1 starts playing.
time relation object verb verb subject3 seconds before EVENT2 finishes, start playing EVENT1.
relation time subject verb relation timeAt 2 minutes, EVENT1 starts playing for 3 seconds.
relation time verb subject relation timeAt 2 minutes, start playing EVENT1 for 3 seconds.
subject verb relation object verb relation timeEVENT1 will start playing when EVENT2 has been stopped for 3 seconds.
verb subject relation object verb relation timeStart playing EVENT1 when EVENT2 has been stopped for 3 seconds.
subject verb time relation object verb relation timeEVENT1 will start playing 1 minute after EVENT2 has been stopped for 3 seconds.
verb subject time relation object verb relation timeStart playing EVENT1 1 minute after EVENT2 has been stopped for 3 seconds.
relation object verb relation time subject verbAfter EVENT2 had been playing for 2 minutes, EVENT1 will start playing for 3 seconds.
relation object verb relation time verb subjectAfter EVENT2 had been playing for 2 minutes, start playing EVENT1 for 3 seconds.

Examples

Subject-Verb-Relation-Time

  • "Event1 had started after 2 minutes."
  • "Event1 started after 2 minutes."
  • "Event1 has played for 2 minutes."
  • "Event1 plays after 2 minutes."
  • "Event1 will start after 2 minutes."
  • "Event1 will have stopped after 2 minutes."
  • "Event1 had been playing for 2 minutes."
  • "Event1 was playing for 2 minutes."
  • "Event1 has been playing for 2 minutes."
  • "Event1 is playing for 2 minutes."
  • "Event1 will be playing for 2 minutes."
  • "Event1 will have been playing for 2 minutes."

Verb-Subject-Relation-Time

  • "Play Event1 after 2 minutes.",

Relation-Time-Subject-Verb

  • "After 2 minutes Event1 had finished."
  • "After 2 minutes Event1 started."
  • "After 2 minutes Event1 has stopped."
  • "After 2 minutes Event1 will play."
  • "After 2 minutes Event1 will have finished."
  • "After 2 minutes Event1 had been playing."
  • "After 2 minutes Event1 was playing."
  • "After 2 minutes Event1 has been playing."
  • "After 2 minutes Event1 is playing."
  • "After 2 minutes Event1 will start playing."
  • "After 2 minutes Event1 will have started playing."

Relation-Time-Verb-Subject

  • "After 2 minutes play Event1."

Subject-Verb-Relation-Object-Verb

  • "Event1 had stopped when Event2 started."
  • "Event1 played when Event2 started."
  • "Event1 has played when Event2 has started."
  • "Event1 will play when Event2 starts."
  • "Event1 will have finished when Event2 starts."
  • "Event1 had been playing when Event2 started."
  • "Event1 was playing when Event2 started."
  • "Event1 has been playing when Event2 starts."
  • "Event1 is playing when Event2 starts."
  • "Event1 will be playing when Event2 starts."
  • "Event1 will have been playing when Event2 starts."

Verb-Subject-Relation-Object-Verb

  • "Play Event1 when Event2 starts.",

Subject-Verb-Time-Relation-Object-Verb

  • "Event1 had started 2 minutes after Event2 finished."
  • "Event1 finished 2 minutes after Event2 started."
  • "Event1 has finished 2 minutes after Event2 has started."
  • "Event1 will play 2 minutes after Event2 starts."
  • "Event1 will have finished 2 minutes after Event2 starts."
  • "Event1 had been playing for 2 minutes after Event2 started."
  • "Event1 was playing for 2 minutes before Event2 started."
  • "Event1 has been playing for 2 minutes after Event2 has stopped."
  • "Event1 is playing for 2 minutes after Event2 stops."
  • "Event1 will be playing for 2 minutes after Event2 starts."
  • "Event1 will have been playing for 2 minutes when Event2 starts."

Verb-Subject-Time-Relation-Object-Verb

  • "Play Event1 2 minutes after Event2 starts."

Time-Relation-Object-Verb-Subject-Verb

  • "2 minutes after Event2 finished, Event1 had started."
  • "2 minutes after Event2 started, Event1 finished."
  • "2 minutes after Event2 has started, Event1 has finished."
  • "2 minutes after Event2 starts, Event1 will play."
  • "2 minutes after Event2 starts, Event1 will have finished."
  • "2 minutes after Event2 started, Event1 had been playing."
  • "2 minutes before Event2 started, Event1 was playing."
  • "2 minutes after Event2 has stopped, Event1 has been playing."
  • "2 minutes after Event2 stops, Event1 is starting."
  • "2 minutes after Event2 starts, Event1 will be playing."
  • "When Event2 starts, Event1 will have been playing."

Time-Relation-Object-Verb-Verb-Subject

  • "2 minutes after Event2 starts, play Event1."

Relation-Time-Subject-Verb-Relation-Time

  • "After 2 minutes, Event1 had played for 1 minute."
  • "After 2 minutes, Event1 played for 3 minutes."
  • "After 2 minutes, Event1 has played for 1 minute."
  • "After 2 minutes, Event1 will play for 3 seconds."
  • "After 2 minutes, Event1 will have played for 3 minutes."
  • "After 2 minutes, Event1 had been playing for 4 seconds."
  • "After 2 minutes, Event1 was playing for 2 minutes."
  • "After 2 minutes, Event1 has been playing for 3 seconds."
  • "After 2 minutes, Event1 is playing for 4 seconds."
  • "After 2 minutes, Event1 will be playing for 3 seconds."
  • "After 2 seconds, Event1 will have started playing for 5 seconds."

Relation-Time-Verb-Subject-Relation-Time

  • "After 3 seconds, play Event1 for 5 seconds."

Subject-Verb-Relation-Object-Relation-Time

  • "Event1 had stopped when Event2 had played for 2 minutes."
  • "Event1 played when Event2 stopped for 2 minutes."
  • "Event1 has played after Event2 has stopped for 2 minutes."
  • "Event1 will play when Event2 stops for 2 minutes."
  • "Event1 will have played when Event2 has been stopped for 2 minutes."
  • "Event1 is playing after Event2 stopped for 2 minutes."
  • "Event1 will be playing after Event2 will have stopped for 3 seconds."
  • "Event1 will have been playing after Event2 has stopped for 5 seconds."

Verb-Subject-Relation-Object-Verb-Relation-Time

  • "Play Event1 after Event2 has stopped for 3 seconds."

Subject-Verb-Time-Relation-Object-Verb-Relation-Time

  • "Event1 had stopped 1 minute after Event2 had played for 2 minutes."
  • "Event1 played 1 minute after Event2 stopped for 2 minutes."
  • "Event1 has started 1 minute after Event2 has stopped for 2 minutes."
  • "Event1 will play 1 minute after Event2 stops for 2 minutes."
  • "Event1 will have played 1 minute after Event2 has been stopped for 2 minutes."
  • "Event1 is playing 1 minute after Event2 stopped for 2 minutes."
  • "Event1 will be playing 1 minute after Event2 has stopped for 2 minutes."
  • "Event1 will have been playing 1 minute after Event2 has stopped for 2 minutes."

Verb-Subject-Time-Relation-Object-Verb-Relation-Time

  • "Play Event1 1 minute after Event2 has stopped for 2 minutes.",

Relation-Object-Verb-Relation-Time-Subject-Verb

  • "After Event2 had played for 2 minutes, Event1 had started."
  • "After Event2 stopped for 2 minutes, Event1 started."
  • "After Event2 has stopped for 2 minutes, Event1 has started."
  • "After Event2 stops for 2 minutes, Event1 will start."
  • "After Event2 has stopped for 2 minutes, Event1 will have played."
  • "After Event2 stopped for 2 minutes, Event1 is playing."
  • "After Event2 has stopped for 2 minutes, Event1 will be playing."
  • "After Event2 will have been playing for 2 minutes, Event1 will have been stopped."

Relation-Object-Verb-Time-Verb-Subject

  • "After Event2 stops for 2 minutes, start Event1."