Ricardo Rocha's Website

Musings on Programming and Programming Languages

Email GitHub Bitbucket Twitter LinkedIn

Spelling Suggestion on the JVM #1: Norvig's Approach to Spelling Correction

This tutorial project implements a basic spelling suggestion service. The motivation is didactic: becoming familiar with “better java” languages around a simple but instructional example. Ease of implementation outranks optimal performance so readers can focus on the JVM languages as such. Examples and new concepts are introduced in Java 10 first so they’re immediately understandable to the experienced Java programmer. Crucially, the Java implementation is accompanied by equivalent (but idiomatic) implementations in today’s most relevant alternative JVM languages: Kotlin, Scala and Xtend. Code is available at Spellbound’s Github repo.

This first post discusses Norvig’s approach to generating typo corrections.

The next post (Implementing Norvig’s Algo in Java) illustrates how to implement Norvig’s spelling corrector in Java 9 following a functional approach.

Read more...

Spelling Suggestion on the JVM #2: Implementing Norvig's Algo in Java

This tutorial project implements a basic spelling suggestion service. The motivation is didactic: becoming familiar with “better java” languages around a simple but instructional example. Ease of implementation outranks optimal performance so readers can focus on the JVM languages as such. Examples and new concepts are introduced in Java 9 first so they’re immediately understandable to the experienced Java programmer. Crucially, the Java implementation is accompanied by equivalent (but idiomatic) implementations in today’s most relevant alternative JVM languages: Kotlin, Scala and Xtend. Code is available at Spellbound’s Github repo.

This second post illustrates how to implement Norvig’s spelling corrector in Java 9 following a functional style.

The next post Implementing Norvig’s Algo in Kotlin presents an idiomatic Kotlin implementation of Norvig’s spelling corrector.

The previous post (Norvig’s Approach to Spelling Correction) discusses Norvig’s approach to generating typo corrections.

Read more...

Spelling Suggestion on the JVM #3: Implementing Norvig's Algo in Kotlin

This tutorial project implements a basic spelling suggestion service. The motivation is didactic: becoming familiar with “better java” languages around a simple but instructional example. Ease of implementation outranks optimal performance so readers can focus on the JVM languages as such. Examples and new concepts are introduced in Java 9 first so they’re immediately understandable to the experienced Java programmer. Crucially, the Java implementation is accompanied by equivalent (but idiomatic) implementations in today’s most relevant alternative JVM languages: Kotlin, Scala and Xtend. Code is available at Spellbound’s Github repo.

This third post presents an idiomatic Kotlin implementation of Norvig’s spelling corrector.

The next post (Implementing Norvig’s Algo in Scala, in the works) presents an idiomatic Scala implementation of Norvig’s spelling corrector.

The previous post (Implementing Norvig’s Algo in Java) illustrates how to implement Norvig’s spelling corrector in Java 9 following a functional style.

Read more...

Spelling Suggestion on the JVM #4: Implementing Norvig's Algo in Scala

This tutorial project implements a basic spelling suggestion service. The motivation is didactic: becoming familiar with “better java” languages around a simple but instructional example. Ease of implementation outranks optimal performance so readers can focus on the JVM languages as such. Examples and new concepts are introduced in Java 9 first so they’re immediately understandable to the experienced Java programmer. Crucially, the Java implementation is accompanied by equivalent (but idiomatic) implementations in today’s most relevant alternative JVM languages: Kotlin, Scala and Xtend. Code is available at Spellbound’s Github repo.

This fourth presents an idiomatic Scala implementation of Norvig’s spelling corrector.

The next post (Implementing Norvig’s Algo in Xtend, in the works) presents an idiomatic Xtend implementation of Norvig’s spelling corrector.

The previous post (Implementing Norvig’s Algo in Kotlin) illustrates how to implement Norvig’s spelling corrector in Kotlin following a functional style.

Read more...

Spelling Suggestion on the JVM #5: Implementing Norvig's Algo in Xtend

This tutorial project implements a basic spelling suggestion service. The motivation is didactic: becoming familiar with “better java” languages around a simple but instructional example. Ease of implementation outranks optimal performance so readers can focus on the JVM languages as such. Examples and new concepts are introduced in Java 9 first so they’re immediately understandable to the experienced Java programmer. Crucially, the Java implementation is accompanied by equivalent (but idiomatic) implementations in today’s most relevant alternative JVM languages: Kotlin, Scala and Xtend. Code is available at Spellbound’s Github repo.

This fifth and last post presents an idiomatic Xtend implementation of Norvig’s spelling corrector.

The previous post (Implementing Norvig’s Algo in Scala) illustrates how to implement Norvig’s spelling corrector in Scala following a functional style.

Read more...

URL Shortener #1: Design

How do we go about designing a URL shortener? This series of articles contrasts the Java and Xtend languages around a very simple URL shortening REST service. Xtend is a JVM language that compiles into readable Java and is fully compatible with all Java frameworks, libraries and tools. If you know Java you already know most of Xtend! A presentation is also available

Read more...

URL Shortener #2: Java Implementation

How do we go about implementing the URL shortener in Java? This series of articles contrasts the Java and Xtend languages around a very simple URL shortening REST service. Xtend is a JVM language that compiles into readable Java and is fully compatible with all Java frameworks, libraries and tools. If you know Java you already know most of Xtend! A presentation is also available

Read more...

URL Shortener #3: The Xtend Main Implementation

How do we go about implementing the service’s Main class in Xtend? This series of articles contrasts the Java and Xtend languages around a very simple URL shortening REST service. Xtend is a JVM language that compiles into readable Java and is fully compatible with all Java frameworks, libraries and tools. If you know Java you already know most of Xtend! A presentation is also available

Read more...

URL Shortener #4: The Xtend Service Implementation

How do we go about implementing the service’s REST interface and components in Xtend? This series of articles contrasts the Java and Xtend languages around a very simple URL shortening REST service. Xtend is a JVM language that compiles into readable Java and is fully compatible with all Java frameworks, libraries and tools. If you know Java you already know most of Xtend! A presentation is also available

Read more...

Building Object Oriented Frameworks (1)

What are object-oriented frameworks? Object oriented frameworks are a mainstay of modern software development. Whether you develop in Java, C#, Objective-C, Python, Ruby or Javascript, chances are you’re basing your development on some sort of application development framework.

Read more...