KWIC_4种架构Assignment及修改版源代码解答


KWIC4种架构的Java实现,以及根据4个Assignment中要求做出的代码修改,还有对Assignment中问题回答。代码全部可以运行通过并实现规定的功能。前人传的现在免分
资源截图
代码片段和文件信息
// -*- Java -*-
/*
 * 
 * 
 *  Copyright (c) 2002
 *  Institute for Information Processing and Computer Supported New Media (IICM)
 *  Graz University of Technology Austria.
 * 
 * 

 * 
 * 
 * 
 *  Name:    KWIC.java
 * 
 *  Purpose: KWIC system for Software Architecture constructional example
 * 
 *  Created: 11 Sep 2002 
 * 
 *  $Id$
 * 
 *  Description:
 *    The basic KWIC system is defined as follows. The KWIC system accepts an ordered 
 *  set of lines each line is an ordered set of words and each word is an ordered set
 *  of characters. Any line may be “circularly shifted“ by repeadetly removing the first
 *  word and appending it at the end of the line. The KWIC index system outputs a
 *  listing of all circular shifts of all lines in alphabetical order.
 * 

 */

package kwic.ms;

/*
 * $Log$
 */

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.JFileChooser;
import javax.swing.text.html.parser.Parser;

/**
 * The KWIC class implements the first architectural solution for the KWIC
 * system proposed by Parnas in 1972. This solution is based on functional
 * decomposition of the system. Thus the system is decomposed into a number of
 * modules each module being a function. All modules share access to data. We
 * call the shared data in this case “core storage“. Thus the architectural
 * style utilized by this solution is main/subroutine architectural style. We
 * have the following modules (functions):
 * 

     * 
  • Master Control (main). This function controls the sequencing among the
     * other four functions.
     * 
  • Input. This function reads the data lines from the input medium (file)
     * and stores them in core for processing by the remaining modules. The
     * chracters are stored into a character array (char[]). The blank space is used
     * to separate the words. An index is kept to show the starting address of each
     * line in the character array. The index is stored as an integer array (int[]).
     * 
  • Circular Shift. This function is called after the input function has
     * completed its work. It prepares an index which gives the address of the
     * first character of each circular shift and the original index of the line in
     * the index array made up by input function. It leaves its output in core with
     * an array of pairs (original line number starting addres). This array is
     * stored as two dimensional integer array (int[][]).
     * 
  • Alphabetizing. This function takes as input the arrays produced by input
     * and circular shift function. It produces an array in the same format
     * (int[][]) as that produced by circular shift function. In this case however
     * the circular shifts are listed in another order (alphabetically).
     * 
  • Output. This function uses the array

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-03-22 15:52  KWIC作业
     文件      471040  2014-03-14 19:38  KWIC作业assignment1-ms.doc
     文件      462336  2014-03-16 23:00  KWIC作业assignment2-oo.doc
     文件      455680  2014-03-17 11:23  KWIC作业Assignment3-es.doc
     文件      281088  2014-03-18 21:33  KWIC作业assignment4-pf.doc
     文件      691384  2014-03-18 21:31  KWIC作业KWIC作业.docx
     目录           0  2014-03-22 15:51  KWIC作业源代码
     文件       12709  2003-08-18 11:14  KWIC作业源代码es_src.zip
     文件        5855  2003-08-18 11:18  KWIC作业源代码ms_src.zip
     文件        9595  2003-08-18 17:35  KWIC作业源代码oo_src.zip
     文件        8991  2003-08-18 17:38  KWIC作业源代码pf_src.zip
     目录           0  2014-03-18 22:37  KWIC作业源代码修改后
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWIC
     文件         301  2014-03-14 10:31  KWIC作业源代码修改后KWIC.classpath
     文件         380  2014-03-14 10:31  KWIC作业源代码修改后KWIC.project
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWIC.settings
     文件         598  2014-03-14 10:31  KWIC作业源代码修改后KWIC.settingsorg.eclipse.jdt.core.prefs
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICin
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICinkwic
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICinkwicms
     文件        5216  2014-03-16 11:32  KWIC作业源代码修改后KWICinkwicmsKWIC.class
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICsrc
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICsrckwic
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWICsrckwicms
     文件       19532  2014-03-16 11:32  KWIC作业源代码修改后KWICsrckwicmsKWIC.java
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWIC_es
     文件         301  2014-03-17 10:16  KWIC作业源代码修改后KWIC_es.classpath
     文件         383  2014-03-17 10:16  KWIC作业源代码修改后KWIC_es.project
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWIC_es.settings
     文件         598  2014-03-17 10:16  KWIC作业源代码修改后KWIC_es.settingsorg.eclipse.jdt.core.prefs
     目录           0  2014-03-18 22:35  KWIC作业源代码修改后KWIC_esin
............此处省略77个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)