[uim-commit] r740 - branches/composer/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Mar 2 05:06:31 PST 2005


Author: yamaken
Date: 2005-03-02 05:06:28 -0800 (Wed, 02 Mar 2005)
New Revision: 740

Added:
   branches/composer/scm/japanese-romaji-custom.scm
Modified:
   branches/composer/scm/Makefile.am
   branches/composer/scm/custom.scm
   branches/composer/scm/ng-japanese-romaji.scm
Log:
* This commit makes kana punctuation and ASCII composition rules
  configurable via custom API

* scm/japanese-romaji-custom.scm
  - New file
  - (group ja-romaji, group ja-romaji-symbols, group
    ja-romaji-punctuations): New custom group
  - (ja-romaji-fullwidth-space-ruleset,
    ja-romaji-fullwidth-basic-symbol-ruleset,
    ja-romaji-fullwidth-number-ruleset,
    ja-romaji-fullwidth-kana-comma-ruleset,
    ja-romaji-fullwidth-kana-period-ruleset): New custom variable
* scm/ng-japanese-romaji.scm
  - require-custom japanese-romaji-custom.scm
  - (ja-romaji-hiragana-ruleset, ja-romaji-katakana-ruleset):
    * Remove unnecessary ja-fullwidth-alphabet-ruleset
    * Make kana punctuation and ASCII composition rules configurable
      via japanese-romaji-custom.scm

* scm/custom.scm
  - require-custom japanese-romaji-custom.scm
* scm/Makefile.am
  - (SCM_FILES): Add japanese-romaji-custom.scm


Modified: branches/composer/scm/Makefile.am
===================================================================
--- branches/composer/scm/Makefile.am	2005-03-02 09:09:01 UTC (rev 739)
+++ branches/composer/scm/Makefile.am	2005-03-02 13:06:28 UTC (rev 740)
@@ -12,8 +12,8 @@
  manage-modules.scm \
  direct.scm \
  legacy-api-bridge.scm \
- ng-japanese.scm ng-japanese-romaji.scm ng-japanese-kana.scm \
- japanese-nicola.scm ng-japanese-azik.scm \
+ ng-japanese.scm ng-japanese-romaji.scm japanese-romaji-custom.scm \
+ ng-japanese-kana.scm japanese-nicola.scm ng-japanese-azik.scm \
  rk.scm \
  generic.scm generic-custom.scm generic-key-custom.scm \
  pyload.scm PY.scm pyunihan.scm pinyin-big5.scm \

Modified: branches/composer/scm/custom.scm
===================================================================
--- branches/composer/scm/custom.scm	2005-03-02 09:09:01 UTC (rev 739)
+++ branches/composer/scm/custom.scm	2005-03-02 13:06:28 UTC (rev 740)
@@ -755,3 +755,7 @@
 
 (prealloc-heaps-for-heavy-job)
 (custom-reload-customs)
+
+;; Since these customs will be loaded only when it is really needed,
+;; we must explicitly load them to customize
+(require-custom "japanese-romaji-custom.scm")

Added: branches/composer/scm/japanese-romaji-custom.scm
===================================================================
--- branches/composer/scm/japanese-romaji-custom.scm	2005-03-02 09:09:01 UTC (rev 739)
+++ branches/composer/scm/japanese-romaji-custom.scm	2005-03-02 13:06:28 UTC (rev 740)
@@ -0,0 +1,126 @@
+;;; japanese-romaji-custom.scm: Customization variables for japanese-romaji
+;;;
+;;; Copyright (c) 2005 uim Project http://uim.freedesktop.org/
+;;;
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+;;; 1. Redistributions of source code must retain the above copyright
+;;;    notice, this list of conditions and the following disclaimer.
+;;; 2. Redistributions in binary form must reproduce the above copyright
+;;;    notice, this list of conditions and the following disclaimer in the
+;;;    documentation and/or other materials provided with the distribution.
+;;; 3. Neither the name of authors nor the names of its contributors
+;;;    may be used to endorse or promote products derived from this software
+;;;    without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+;;;;
+
+(require "i18n.scm")
+
+
+(define-custom-group 'ja-romaji
+                     (_ "Japanese romaji")
+                     (_ "Japanese romaji"))
+
+;; subgroup
+(define-custom-group 'ja-romaji-symbols
+                     (_ "Symbolic characters for fullwidth kana modes")
+                     (_ "Symbolic characters for fullwidth kana modes"))
+
+;; subgroup
+(define-custom-group 'ja-romaji-punctuations
+                     (_ "Punctuation marks for fullwidth kana modes")
+                     (_ "Punctuation marks for fullwidth kana modes"))
+
+;;
+;; Alphanumeric and symbolic characters
+;;
+
+(define-custom 'ja-romaji-fullwidth-space-ruleset
+  'ja-fullwidth-space-ruleset
+  '(ja-romaji ja-romaji-symbols)
+  (list 'choice
+	(list 'ja-halfwidth-space-ruleset
+	      (_ "Halfwidth space")
+	      (_ "Halfwidth space"))
+	(list 'ja-fullwidth-space-ruleset
+	      (_ "Fullwidth space")
+	      (_ "Fullwidth space")))
+  (_ "Space character")
+  (_ "long description will be here."))
+
+(define-custom 'ja-romaji-fullwidth-basic-symbol-ruleset
+  'ja-fullwidth-basic-symbol-ruleset
+  '(ja-romaji ja-romaji-symbols)
+  (list 'choice
+	(list 'ja-halfwidth-basic-symbol-ruleset
+	      (_ "Halfwidth symbols")
+	      (_ "Halfwidth symbols"))
+	(list 'ja-fullwidth-basic-symbol-ruleset
+	      (_ "Fullwidth symbols")
+	      (_ "Fullwidth symbols")))
+  (_ "Symbolic characters")
+  (_ "long description will be here."))
+
+(define-custom 'ja-romaji-fullwidth-number-ruleset
+  'ja-fullwidth-number-ruleset
+  '(ja-romaji ja-romaji-symbols)
+  (list 'choice
+	(list 'ja-halfwidth-number-ruleset
+	      (_ "Halfwidth numbers")
+	      (_ "Halfwidth numbers"))
+	(list 'ja-fullwidth-number-ruleset
+	      (_ "Fullwidth numbers")
+	      (_ "Fullwidth numbers")))
+  (_ "Numeric characters")
+  (_ "long description will be here."))
+
+;;
+;; Punctuation marks
+;;
+
+(define-custom 'ja-romaji-fullwidth-kana-comma-ruleset
+  'ja-fullwidth-kana-comma-ruleset
+  '(ja-romaji ja-romaji-punctuations)
+  (list 'choice
+	(list 'ja-halfwidth-comma-ruleset
+	      (_ "Halfwidth comma")
+	      (_ "Halfwidth comma"))
+	(list 'ja-fullwidth-comma-ruleset
+	      (_ "Fullwidth comma")
+	      (_ "Fullwidth comma"))
+	(list 'ja-fullwidth-kana-comma-ruleset
+	      (_ "Fullwidth kana comma")
+	      (_ "Fullwidth kana comma")))
+  (_ "Comma character")
+  (_ "long description will be here."))
+
+(define-custom 'ja-romaji-fullwidth-kana-period-ruleset
+  'ja-fullwidth-kana-period-ruleset
+  '(ja-romaji ja-romaji-punctuations)
+  (list 'choice
+	(list 'ja-halfwidth-period-ruleset
+	      (_ "Halfwidth period")
+	      (_ "Halfwidth period"))
+	(list 'ja-fullwidth-period-ruleset
+	      (_ "Fullwidth period")
+	      (_ "Fullwidth period"))
+	(list 'ja-fullwidth-kana-period-ruleset
+	      (_ "Fullwidth kana full stop")
+	      (_ "Fullwidth kana full stop")))
+  (_ "Period character")
+  (_ "long description will be here."))

Modified: branches/composer/scm/ng-japanese-romaji.scm
===================================================================
--- branches/composer/scm/ng-japanese-romaji.scm	2005-03-02 09:09:01 UTC (rev 739)
+++ branches/composer/scm/ng-japanese-romaji.scm	2005-03-02 13:06:28 UTC (rev 740)
@@ -35,6 +35,7 @@
 ;; http://ja.wikipedia.org/wiki/%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97
 
 (require "ng-japanese.scm")
+(require-custom "japanese-romaji-custom.scm")
 
 
 ;;
@@ -607,12 +608,11 @@
 ;; may be replaced with more efficient way for ruleset composition(merging)
 (define ja-romaji-hiragana-ruleset
   (append
-   ja-fullwidth-space-ruleset
-   ja-fullwidth-kana-period-ruleset
-   ja-fullwidth-kana-comma-ruleset
-   ja-fullwidth-basic-symbol-ruleset
-   ja-fullwidth-number-ruleset
-   ja-fullwidth-alphabet-ruleset
+   (symbol-value ja-romaji-fullwidth-space-ruleset)
+   (symbol-value ja-romaji-fullwidth-basic-symbol-ruleset)
+   (symbol-value ja-romaji-fullwidth-number-ruleset)
+   (symbol-value ja-romaji-fullwidth-kana-period-ruleset)
+   (symbol-value ja-romaji-fullwidth-kana-comma-ruleset)
    ja-romaji-hiragana-basic-ruleset
    ja-romaji-hiragana-double-consonant-guide-ruleset
    ja-romaji-hiragana-basic-double-consonant-ruleset
@@ -631,12 +631,11 @@
 
 (define ja-romaji-katakana-ruleset
   (append
-   ja-fullwidth-space-ruleset
-   ja-fullwidth-kana-period-ruleset
-   ja-fullwidth-kana-comma-ruleset
-   ja-fullwidth-basic-symbol-ruleset
-   ja-fullwidth-number-ruleset
-   ja-fullwidth-alphabet-ruleset
+   (symbol-value ja-romaji-fullwidth-space-ruleset)
+   (symbol-value ja-romaji-fullwidth-basic-symbol-ruleset)
+   (symbol-value ja-romaji-fullwidth-number-ruleset)
+   (symbol-value ja-romaji-fullwidth-kana-period-ruleset)
+   (symbol-value ja-romaji-fullwidth-kana-comma-ruleset)
    ja-romaji-katakana-basic-ruleset
    ja-romaji-katakana-double-consonant-guide-ruleset
    ja-romaji-katakana-basic-double-consonant-ruleset



More information about the Uim-commit mailing list