I'm trying to mess around with this program and cannot seem to get the declarations right with the BoyerMoore constructor. Can someone help me?
Error: Cannot resolve symbol: method BoyerMoore() ...
Code:import java.io.*; public class BoyerMoore { public static final int ALPHABET_SIZE = Character.MAX_VALUE + 1; private static String text; private static String pattern; private int[] last; private int[] match; private int[] suffix; public static void main(String args[]) throws FileNotFoundException, IOException { DataInputStream f; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); if (args.length == 0) // Read graph from standard input { System.out.println("Please include file in run parameters!"); f = new DataInputStream(System.in); } else { // Data file entered as parameter f = new DataInputStream(new FileInputStream(args[0])); } text = f.readLine(); pattern = in.readLine(); BoyerMoore(pattern, text); /* Error is here */ } public BoyerMoore(String pattern, String text) { this.text = text; this.pattern = pattern; last = new int[ALPHABET_SIZE]; match = new int[pattern.length()]; suffix = new int[pattern.length()]; } /* other classes . . . */ }


Reply With Quote


Bookmarks