doppio.link
JIM
a Java Indexing Machine
This is only A Test.

a Java Indexing Machine
A Test. | This is only
Indexing Machine | a Java
Java Indexing Machine | a
Machine | a Java Indexing
Test. | This is only A
This is only A Test.

Go to doppio > here
Enter 'cd classes' and 'java JIM'

Or Cut and Paste JIM to here, Compile and Execute

TO USE, ONE simply enters a title, headline, phrase,
fields, or sentence, capitalizing those words for which
an alphabetical KWIC (key word in context) subject heading
is desired. To finish, enter a lone space. The screen output
can be cut and pasted into the document on your computer.

# JIM - prototype java indexing machine
# by J. Doug Ohmans 
# Copyright (C) 2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
import java.util.*;
import java.io.*;

public class JIM {
    public static void main(String[] args)
            throws IOException {
        System.out.println();
        System.out.println("a Java Indexing Machine");
        System.out.println("parses and sorts to:");
        System.out.println("Indexing Machine | a Java");
        System.out.println("Java Indexing Machine | a");
        System.out.println("Machine | a Java Indexing");

        File binTemp = new File("binOutput.txt");
        if (!binTemp.exists()) {
            binTemp.createNewFile();
        }
        File binTmpo = new File("binObject.txt");
        if (!binTmpo.exists()) {
            binTmpo.createNewFile();
        }
        binList.main(null);
        binParse.main(null);

        Scanner sorter = new Scanner(new File("binOutput.txt"));
        ArrayList binSorted = new ArrayList();
        String str;
        while (sorter.hasNextLine()) {
            str = sorter.nextLine();
            binSorted.add(str);
        }
        Collections.sort(binSorted, new Comparator() {
        @Override
        public int compare(String s1, String s2) {
            return s1.compareToIgnoreCase(s2);
            }
        });
        PrintWriter writer = new PrintWriter("binSorted.txt");
        for (int i = 0; i < binSorted.size(); i++) {
            System.out.println(binSorted.get(i));
        }
        System.out.println();
        for (String Str: binSorted) {
            writer.write(Str + "\n");
        }
        writer.close();
        sorter.close();
        binTemp.delete();
    }
}

# binList - prototype java indexing machine
# by J. Doug Ohmans 
# Copyright (C) 2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
import java.util.*;
import java.io.*;

public class binList {
    public static void main(String[] args)
            throws IOException {

        Scanner getter = new Scanner(new File("binObject.txt"));
        ArrayList binObject = new ArrayList();
        while (getter.hasNextLine()) {
            String str = getter.nextLine();
            if (!str.equals("") && !str.equals(" ")) {
                binObject.add("\n" + str);
                System.out.print(str);
            }
            System.out.println();
        }

        Scanner adder = new Scanner(System.in);
        char quit = '*';
        while (quit != ' ') {
            System.out.print("Enter Entity or ' ': ");
            String str = adder.nextLine();
            binObject.add("\n" + str);

            String tmpo = str.toUpperCase();
            quit = tmpo.charAt(0);
        }

        PrintWriter writer = new PrintWriter("binObject.txt");
        for (String str: binObject) {
            writer.write(str);
        }

        writer.close();
        adder.close();
        getter.close();
    }
}

# binParse - prototype java indexing machine
# by J. Doug Ohmans 
# Copyright (C) 2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
import java.util.*;
import java.io.*;

public class binParse {
    public static void main(String[] args)
        throws IOException {

    String Str = "";
    File binObject = new File("binObject.txt");
    PrintWriter writer = new PrintWriter("binOutput.txt");
    Scanner getter = new Scanner(binObject);
    theString = getter.nextLine();
    while (getter.hasNextLine()) {
        Str = getter.nextLine();
        writer.write(Str + "\n");
        char[] binArray = Str.toCharArray();
        int size = Str.length();
        for (int i = 1; i < size; i++) {
            if ((binArray[i] >= 'A') && (binArray[i] <= 'Z')) {
                int indx = i;
                for (int j = indx; j < size; j++) {
                    writer.write(binArray[j]);
                }
                writer.write(" | ");
                for (int j = 0; j < indx; j++) {
                    writer.write(binArray[j]);
                }
                writer.write("\n");
                }
            }
        }
    getter.close();
    writer.close();
    }
}