Cross-Referencing for Bilingual Electronic Legal Documents in HKLII

K H Pun, Eric Chan, K P Chow, C F Chong, Jasmine Ma
Lucas Hui, W W Tsang, H W Chan

Department of Computer Science
The University of Hong Kong

Abstract
HKLII provides the general public on the Internet with free legal information relating to Hong Kong. One of the main advantages of HKLII over some of the other legal databases is the provision of hyperlinks creating inter and intra cross-referencing between statutes and judicial decisions. Such cross-referencing is partly achieved by a well-organised website structure and a simple naming convention. In the case of statutes, URLs are generated automatically based on the statute number or the acronym of statute name. In the case of judicial decisions, generation of URLs is less straightforward, as references to judicial decisions may take a variety of forms. One particular problem for HKLII arises from its bilingual nature, with its databases containing both English and Chinese documents. Before hyperlinks can be created, references to both English and Chinese documents must first be identified. Unlike English, there is no delimiter between words in Chinese, which makes it difficult to identify keywords required for indexing Chinese documents. This paper describes some of the problems we have encountered in adding hyperlinks to the English and Chinese documents in HKLII, and our progress thus far.

Hong Kong Legal Information Institute (HKLII) [6] is a joint project between the Department of Computer Science and the Faculty of Law within the University of Hong Kong. HKLII owes its genesis to AustLII [1], and was greatly assisted by the technical staff of AustLII during its initial stage of development. As a member of the World Legal Information Institute (WorldLII) [14], HKLII provides free legal information relating to Hong Kong which includes, among other things, statutes (i.e., ordinances), regulations, judicial decisions, practice directions, and law reform consultation documents and reports to the general public. Such information is made available to anyone who has access to the Internet, without any charge or registration requirement. The primary legal information in the databases of HKLII is statutes and judicial decisions. Statutes are reproduced by HKLII from data fed by the Bilingual Laws Information System (BLIS) [2] of the Department of Justice of the Hong Kong Special Administrative Region (HKSAR) [4], and judicial decisions are reproduced from data obtained from the website of the Judiciary of the HKSAR [7]. While these statutes and judicial decisions are also freely available on the websites of the Department of Justice and the Judiciary, HKLII adds value to the data by providing a more user-friendly interface with additional features, the most notable of which is inter and intra cross-referencing between statutes and judicial decisions by means of hyperlinks. This makes HKLII a convenient and useful website for searching legal information relating to Hong Kong, which is reflected by a steady increase in the number of visitors to the website since its inception.
	One problem unique to HKLII stems from the bilingual nature of the legal system in Hong Kong, as a result of which legal information relating to Hong Kong may appear in Chinese, or English, or both. This requires HKLII to have the capability of handling both Chinese and English documents. However, because of the problems of encoding and segmentation (i.e., ambiguities in recognizing word boundaries) for the Chinese language, there are difficulties in searching over Chinese documents [11] which are not present for the English language. Similar problems also exist relating to the creation and manipulation of hyperlinks between Chinese documents, which requires the correct identification of references before hyperlinks can be created and inserted at the proper places within the documents. These problems, and our experience in dealing with them thus far, are discussed in the following sections.

References to Statutes for English Documents
Hyperlinking to Hong Kong statutes
In HKLII, hyperlinks are created for references to statutes within English documents, which may be documents of statutes or judicial decisions. If the statute referred to is a Hong Kong statute (i.e., an ordinance), the reference is invariably based on the statute name, or the chapter number, or both. As an example, the new Hong Kong statute on trade marks is referred to either by the name "Trade Marks Ordinance", or by the chapter number "Cap. 559", or by the combination "Trade Marks Ordinance (Cap. 559)". Thus to add hyperlinks pointing to Hong Kong statutes in these English documents, one generally only needs to recognise the statute names and chapter numbers. Fortunately, both the name and chapter number of a Hong Kong statute adopt formats that allow automatic identification using scripts. The chapter number of a Hong Kong statute is invariably expressed in the form "Cap. xxx", where "xxx" is the chapter number. Accordingly, references to statutes by their chapter numbers can be easily identified by searching for the word "Cap". In a similar vein, the name of a Hong Kong statute invariably uses the format "the xxx Ordinance", where xxx is the name of the statute. Hence, references to statutes by their names can be identified by searching for groups of capitalized words after the word "the" and ending in the word "Ordinance". These identification operations are performed using programs and scripts adapted from those developed by AustLII. 
	In addition to creating hyperlinks to existing statutes, HKLII also creates and maintains hyperlinks to past versions of Hong Kong statutes and individual sections within a statute. Hyperlinks to past versions of statutes are relevant to judicial decisions which were decided under an old version of a statute, and hyperlinks to individual sections within a statute are useful when the user is only interested in a specific provision rather than the statute as a whole. In creating such hyperlinks, HKLII makes the assumption that if a Hong Kong statute refers to a particular section without any indication as to the chapter number or statute name for that section, that section is to be found in the same statute.
	To facilitate the creation of hyperlinks to Hong Kong statutes, the website architecture of HKLII is designed to reflect the way in which a Hong Kong statute is referenced. As each Hong Kong statute is identified by a unique chapter number, the statute documents in HKLII are stored in folders named according to the chapter numbers of the statutes. As an example, documents containing the statutory provisions of the Trade Marks Ordinance (Chapter 559) are all stored in a folder called "559" within HKLII's ordinance folder "ord", with URL http://www.hklii.org/hk/legis/ord/559/. Within the folder, each section is stored as a separate file referenced by URL http://www.hklii.org/hk/legis/ord/559/snn.html, where nn is the section number. This architecture facilitates the construction of URL for hyperlinks to Hong Kong statutes and the individual sections contained within a statute. Once a statute is identified, the URL for the statute and the sections contained therein can be constructed easily from mappings between the statute and the corresponding folder, and between the section and the corresponding file, by way of a table lookup.
	However, incorrect hyperlinks to a Hong Kong statute may sometimes result even though the statute has been correctly identified. One reason for this is that a statute may have current and past versions, which are all kept in the same folder named according to the chapter number. Thus there is always a possibility of incorrect hyperlinking, as it is not easy to judge whether a hyperlink should point to the current version of a statute, or a past version. Furthermore, different versions of a Hong Kong statute may occasionally not share the same chapter number, which also increases the chance of creating incorrect hyperlinks. A good example is the Copyright Ordinance, which was changed from Cap 39 to Cap 528 in 1997. One consequence of all this is that unless the software for creating hyperlinks is intelligent enough to identify the correct version of a statute referred to in a document, there is always a possibility of linking to the wrong version of a statute. Currently, in the absence of such intelligent software, HKLII adopts a very simple approach for creating hyperlinks to Hong Kong statutes: namely, that all such hyperlinks will point to the latest version of the statutes. Although this is by no means accurate in all circumstances, it is the simplest and most practical approach that HKLII can adopt at this stage. The more complex and sophisticated issue of ascertaining the correct version of a statute to be linked to, as judged from the context in which the statute is referred, will be the subject of future investigation.
	Another problem with Hong Kong statutes which has complicated the task of creating hyperlinks is that a statute name may occasionally change over time. A good example is the Multi-Storey Buildings (Owners Incorporation) Ordinance (Cap. 344), which was substantially revamped in 1993 and re-titled as the Building Management Ordinance (Cap. 344). At present, HKLII maps only the current name of a Hong Kong statute to its corresponding chapter number; hence it is unable to generate a hyperlink to a statute if the reference to it is based on its old name. However, because statutes with obsolete names are not common in Hong Kong, issues arising from references based on old names of statutes are currently not a priority concern for HKLII and will be dealt with only when other more pressing issues have been resolved. 

Hyperlinking to foreign statutes
Apart from creating hyperlinks to Hong Kong statutes, HKLII also provides hyperlinks to foreign statutes stored in WorldLII, such as the UK Acts kept on BAILII [3] and the Australian Acts on AustLII [1]. Hyperlinks to such statutes are created based on their locations in WorldLII and the format for referring them. Generally, references to foreign statutes share the same format: the statute name, followed by the year in which it was enacted (eg. the "Human Fertilisation and Embryology (Disclosure of Information) Act 1992"). In the case of UK Acts, references to a statute may also include the chapter number of the statute (eg "the Patents Act 1977 c. 37"), or may simply be in the form of "year, chapter number" (eg "1988 c. 48"). Relying on these formats and the locations of the foreign statutes in WorldLII, the URL of a foreign statute can be constructed based on the format of a reference to the statute, thereby creating a hyperlink for the reference. 
	In a similar fashion, HKLII also provides hyperlinks to foreign judicial decisions stored in WorldLII. As in the case of statutes, there is a common format for references to these decisions: namely, the year (enclosed within square or round brackets) in which the case was decided, the acronym of the court name, and the case number (eg "[2001] EWCA Civ 342"). Generally, the file organisation of foreign judicial decisions also reflects this common format, with the full path of the file name of a decision resembling the format by which the decision is referred. This makes it relatively straightforward to construct the URL of a decision from the format by which it is referred. 

References to Statutes for Chinese Documents
The creation and manipulation of hyperlinks to statutes in Chinese documents is not as simple as in the case of English documents. As explained in [11], one of the major problems in processing Chinese documents is the segmentation problem i.e.,. ambiguities in recognizing Chinese words. This problem also presents itself in the creation of hyperlinks in Chinese documents, as references to statutes and judicial decisions in Chinese documents are not as readily recognizable as in the case of English documents. The problem is slightly less complicated where the reference is to a statute, as such a reference usually contains certain keywords. To illustrate this, consider the following sentence in Chinese: " 被 告 等 應 有 權 按 商 標 條 例 第 29 條 登 記 為 同 時 使 用 者 " ("The Defendants have the rights under section 29 of the Trade Marks Ordinance to be registered as concurrent users."). To create a hyperlink to the statute " 商 標 條 例 " ("the Trade Marks Ordinance") referred to in the sentence, the statute name must first be recognised. One method to achieve this is to scan the words in the sentence sequentially and look for any string that matches an entry in the dictionary of statute names. But this method is time-consuming and inefficient. A better method is to look for the Chinese keyword " 條 例 " ("Ordinance") and then search the preceding words for a statute name. However, this is still inefficient as the preceding words may have different ways of being segmented, and each possible segmentation has to be checked against each entry in the dictionary of statute names. Fortunately, in many Chinese documents in HKLII, statute names are enclosed within angle brackets, as in 《 商 標 條 例 》 ("the Trade Marks Ordinance"), which greatly eases the task of recognizing statute names. The only problem, though, is that angle brackets are not merely used to delimit statute names, and thus it is still necessary to ascertain whether the string enclosed within a pair of angle brackets is indeed the name of a statute.
	The current method used by HKLII for recognizing statute names in Chinese documents is to use the built-in regular expression and UTF-8 support in Perl [10] to search for pairs of angle brackets, and then check if the string enclosed within each pair of brackets matches any statute name. We are also experimenting with a method which builds a hash table based on the last two Chinese characters of a statute name preceding the word " 條 例 " ("Ordinance"), and which uses the table to perform partial matching of statute names when the word "條 例 " ("Ordinance") is found in a Chinese document. This hopefully will shorten the time required for recognizing statute names in Chinese documents.
	Nonetheless, as in the case of English documents, issues mentioned earlier arising from the different versions of a statute, the different names and chapter numbers for the same statute are also present for Chinese documents. It is envisaged that solutions for resolving such issues for English documents should also be applicable to Chinese documents.

References to Judicial Decisions
At present, HKLII does not provide hyperlinks to judicial decisions because of certain technical problems. In HKLII, a judicial decision is usually referred to by the plaintiff's name, the defendant's name, and a citation. A typical example is "Cheng v Tse (2002) 3 HKCFAR 339". However, because of the design of the Hong Kong Judiciary, the filenames for judicial decisions are based on their case numbers rather than the information by which they are referred. Hence the URL of a judicial decision is associated with its case number. As such, the URL cannot be constructed directly from the information by which the decision is referred to. In theory, whether a judicial decision is the correct target of a reference can be ascertained by checking the names of the parties appearing in the decision. Unfortunately there can be more than one decision with the same plaintiff and defendant names, and thus even when a decision is found to contain the correct party names, it is still not entirely certain whether the decision is indeed the correct one to be linked to.
	Another issue relating to this is that virtually all citations of judicial decisions in Hong Kong refer to published law reports. The example above, "Cheng v Tse (2002) 3 HKCFAR 339", is typical. The citation therein refers to the Hong Kong Court of Final Appeal Reports ("HKCFAR") published by Sweet & Maxwell Asia [13]. However, because a decision may be published in more than one law report, the same decision may have more than one citation. To facilitate the construction of URLs for such decisions, one needs to have a primary key for each decision which can be readily recognized and mapped onto the URL of the decision, regardless of how many citations the decision may have. This has led to the development of a parallel citation table in HKLII which contains a primary key for each Hong Kong decision along with all the citations for the decision. The use of such a table is discussed under "Parallel Citations for Judicial Decisions" below. 
	Apart from Hong Kong decisions, HKLII also aims to construct hyperlinks to decisions of other jurisdictions stored in WorldLII. Because these decisions generally have more than one citation, we again have to rely on a parallel citation table for these decisions. Once such a table is built, hyperlinks to these decisions can be created by a script based on the primary key of each decision and the location of the decision in WorldLII.  

Documents Referring to Statutes
In addition to creating hyperlinks to statutes in documents, HKLII also provides a convenient and complementary function which lists out all documents that refer to a particular statute. For every statute stored in HKLII, there is a pre-defined query embedded in the web page which searches for all documents referring to the statute. This feature, called Noteup, is developed by AustLII using their Sino search engine [5][12]. As Sino currently works only on English documents and not Chinese documents, this feature is not available for Chinese documents. The possibility of providing the same feature using the mnoGoSearch [9] search engine for Chinese is currently being developed by HKLII.

Parallel Citations for Judicial decisions
Unlike the judicial decisions reported in law reports, judicial decisions kept in HKLII do not have headnotes or commentaries, and are meant to be free legal information for the general public. However, when Hong Kong judges refer to a decision, they would as a rule refer to the decision as published in a law report, using the citation of the latter. As a decision may be published in more than one law report, the same decision may be cited differently in different judgments. This prompts for a parallel citation table which lists out all the citations for each decision. Such a table has been partly constructed in HKLII, which covers decisions of the Court of Final Appeal from 1997 to 2003 and which includes citations based on the following: (1) The Hong Kong Court of Final Appeal Reports (HKCFAR) by Sweet & Maxwell Asia [13], (2) Hong Kong Law Reports & Digest (HKLRD) by Sweet & Maxwell Asia, (3) Hong Kong Cases (HKC) by LexisNexis Butterworths [8], (4) Hong Kong Unreported Judicial decisions (HKCU) by LexisNexis Butterworths, and (5) Hong Kong Electronic Cases (HKCU), the latest decisions alert service by Sweet & Maxwell Asia.
	The parallel citation table serves at least two purposes. First, it provides useful additional information to the general public. A user who finds a decision in HKLII is able to find all its citations from the parallel citation table. Secondly, by designating a primary key for each decision, the URL of the decision only needs to be associated with the primary key. Any citation of the decision can be mapped onto this URL via the primary key as indicated in the parallel citation table.
	The parallel citation table in HKLII is prepared manually by the Lui Che Woo Law Library of the University of Hong Kong. It is possible to generate the parallel citation table automatically if HKLII has free access to electronic versions of the reported decisions in law reports, as the latter should contain information for mapping the case number of a decision to its citations in law reports. But currently we do not have such free access. The parallel citation table at present is kept in an MS-Excel file in a format as shown in Table 1 (with the rows printed as columns for better layout). As the file name of a Hong Kong decision is based on its case number, the case number is chosen as the primary key for a decision and associated with the URL of the decision. Such a parallel citation table facilitates the creation of hyperlinks to decisions with citations based on law reports, as the primary key for such decisions can be found from the table, and thus their URLs.

	Example 1	Example 2	
Year	1997	1998	
Case name	CHAN SZE TING and Another v. HONG KONG SPECIAL ADMINISTRATIVE REGION	HKSAR v. LAM CHI KEUNG	
Action	FAMC000004/1997	FAMC000012/1997	
Date	18 December 1997	26 February 1998	
HKLII Citation	[1997] HKCFA 7	[1998] HKCFA 8	
HKCFAR	[1997-98] 1 HKCFAR 46		
HKLRD	[1998] 1 HKLRD 45	[1998] 1 HKLRD 440	
HKC		[1998] 1 HKC 499	
HKCU	[1997] 978 HKCU 1; [1997] 388 HKCU 1		
HKEC		[1999] HKEC 1030	

Table 1. 

Extract of a parallel citation table in HKLII 
(rows in the table are shown as columns for better layout)

	At present, HKLII does not have a parallel citation table for decisions in Chinese, as there are still very few decisions in Chinese which are published in law reports to date. However, since both English and Chinese decisions use the same format for their case numbers, a parallel citation table for decisions in Chinese can be created, if the need arises, using the same method as that for decisions in English. At the time of writing, a comprehensive parallel citation table comprising of all decisions stored in HKLII has not yet been completed. It is envisaged that once the table is done, the creation of hyperlinks to judicial decisions can be done automatically by means of scripts.

Conclusion
The bilingual legal system in Hong Kong requires HKLII to provide legal information in both Chinese and English. This paper has discussed some of the issues in creating and manipulating hyperlinks between statutes and judicial decisions in HKLII. In the case of Chinese documents, the issues are coupled with the problem of segmentation in processing Chinese i.e., ambiguities in recognising Chinese words. At the time of writing, hyperlinks to statutes are provided in HKLII, whereas hyperlinks to judicial decisions are not available in HKLII because of certain technical difficulties, particularly the different ways by which a decision can be cited. This has given rise to the need for a parallel citation table, which facilitates the creation of hyperlinks to judicial decisions regardless of how they are cited.  The automatic generation of such a table is currently under investigation. It is expected that once a comprehensive parallel citation table is completed, the creation of hyperlinks to judicial decisions can be done automatically by means of scripts.

References
[1]	Australian Legal Information Institute (AustLII), http://www.austlii.edu.au
[2]	Bilingual Laws Information System (BLIS), http://www.justice.gov.hk/eng/index.htm
[3]	British and Irish Legal Information Institute (BAILII), http://www.bailii.org
[4]	Department of Justice (DoJ) of HKSAR, http://www.doj.gov.hk
[5]	Graham Greenleaf, Andrew Mowbray, Geoffrey King, Simon Cant, and Philip Chung. More Than Wishful Thinking: AustLII's Legal Inferencing via the World Wide Web, In Proceedings of the sixth International Conference on Artificial Intelligence and Law, pages 47-55, Melbourne, Australia, June 1997.
[6]	Hong Kong Legal Information Institute (HKLII), http://www.hklii.org.hk
[7]	Judiciary of HKSAR, http://www.judiciary.gov.hk/en/legal_ref/judicial decisions.htm
[8]	LexisNexis, http://www.lexisnexis.com.hk
[9]	mnoGoSearch, http://www.mnogosearch.org
[10]	Perl, http://www.perl.org
[11]	K. H. Pun, Gary Ip, C. F. Chong, Vivien Chan, K. P. Chow, Lucas Hui, W. W. Tsang, and H. W. Chan. Processing Legal Documents in the Chinese-Speaking World: the Experience of HKLII, In Proceedings of the fifth Conference on Computerisation of Law via the Internet 2003, Sydney, Australia, November 2003
[12]	Sino (Size is no object), http://www.austlii.edu.au/austlii/help/sino.html
[13]	Sweet & Maxwell Asia, http://www.smlawpub.com.hk
[14]	World Legal Information Institute (WorldLII), http://www.worldlii.org