public static void main(String args[]) {

		try {

			if (args.length != 2) {
				System.err.println("usage: java ProcessorDemo <filename> <charset>");
				System.exit(1);
			}

			BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(args[0]), args[1]));
			String confPath = System.getProperty("sen.home") + System.getProperty("file.separator") + "conf/sen-processor.xml";
			StringTagger stringTagger = SenFactory.getStringTagger(confPath);
			StreamTagger tagger = new StreamTagger(stringTagger, reader);
			readConfig(confPath);

			if (useCompoundFilter) {
				CompoundWordFilter filter = new CompoundWordFilter(compoundFile);
				tagger.addFilter(filter);
			}

			if (compositeRules != null && !compositeRules.equals("")) {
				CompositeTokenFilter filter = new CompositeTokenFilter();
				filter.readRules(new BufferedReader(new StringReader(compositeRules)));
				tagger.addFilter(filter);
			}

			if (commentRules != null && !commentRules.equals("")) {
				CommentFilter filter = new CommentFilter();
				filter.readRules(new BufferedReader(new StringReader(commentRules)));
				tagger.addFilter(filter);
			}

			while (tagger.hasNext()) {
				Token token = tagger.next();
				System.out.println(
						token.getSurface() + "\t" +
						token.getMorpheme().getPartOfSpeech() + "\t" +
						token.getStart() + "\t" +
						token.end() + "\t" +
						token.getCost() + "\t" +
						token.getMorpheme().getAdditionalInformation()
				);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}