doppio.link
Java Indexing Machine
test.
A Java Indexing Machine
99 the Rain in Spain falls mainly on the Plain
==>
99 the Rain in Spain falls mainly on the Plain
Indexing Machine | A Java 
Java Indexing Machine | A 
Machine | A Java Indexing 
Plain | 99 the Rain in Spain falls mainly on the 
Rain in Spain falls mainly on the Plain | 99 the 
Spain falls mainly on the Plain | 99 the Rain in 
test.


Java environment: go to doppio > here

Enter 'cd classes' and 'java PlsAllow'

TO USE the ArrayList, you simply enter a title,
headline, sentence, phrase, or locator and
fields, capitalizing those words for which
an alphabetical KWIC (key word in context)
subject heading is desired. A lower-case first
letter or numbering will also create an index
entry. To finish, enter a lone space. The
screen output can be cut and pasted into the
document on your computer. See above video.

Or for files, Cut and Paste modules below here, compile and execute JIM.java

/* 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("test.");        
        System.out.println("A Java Indexing Machine");
        System.out.println("99 the Rain in Spain falls mainly on the Plain");
        System.out.println("==>");
        System.out.println("99 the Rain in Spain falls mainly on the Plain");
        System.out.println("Indexing Machine | A Java");
        System.out.println("Java Indexing Machine | A");
        System.out.println("Machine | A Java Indexing");
        System.out.println("Plain | 99 the Rain in Spain falls mainly on the");
        System.out.println("Rain in Spain falls mainly on the Plain | 99 the");
        System.out.println("Spain falls mainly on the Plain | 99 the Rain in");
        System.out.println("test.");

        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();
    }
}

/* 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 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("")) {
                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 Enter  ");
            String str = adder.nextLine();
            if (str.equals(""))
                str = " ";
           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();
    }
}

/* 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 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);
    writer.write("\n");
    while (getter.hasNextLine()) {
        Str = getter.nextLine();
        char[] binArray = Str.toCharArray();
        int size = Str.length();
        for (int i = 1; i < size; i++) {
            if ((i == 1 && binArray[0] >= 'a' && binArray[0] <= 'z') || (i == 1 && binArray[0] >= '0' && binArray[0] <= '9')) {
                writer.write(Str + "\n");
            } else {
            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();
    }
}