[htdig3-dev] [PATCH] plural suffix patch for 3.1.5


Subject: [htdig3-dev] [PATCH] plural suffix patch for 3.1.5
From: J. op den Brouw (MSQL_User@st.hhs.nl)
Date: Wed Mar 15 2000 - 04:53:43 PST


This is the plural suffix patch for 3.1.5 because in some
languages the suffix for plurals is not always "s".

It is used in the header pages where you need a plural
form of "document".

This does not address the problem in some languages that
have different extensions for plural and singular like
italian.

configuration option: plural_suffix
default: s

For Holland it would be

plural_suffix: en

diff -urp htdig-3.1.5/htcommon/defaults.cc htdig-3.1.5-plural/htcommon/defaults.cc
--- htdig-3.1.5/htcommon/defaults.cc Fri Feb 25 03:29:10 2000
+++ htdig-3.1.5-plural/htcommon/defaults.cc Wed Mar 15 13:16:06 2000
@@ -116,6 +116,7 @@ ConfigDefaults defaults[] =
     {"page_list_header", "<hr noshade size=2>Pages:<br>"},
     {"page_number_separator", "\" \""},
     {"page_number_text", ""},
+ {"plural_suffix", "s"},
     {"prefix_match_character", "*"},
     {"prev_page_text", "[prev]"},
     {"remove_bad_urls", "true"},
diff -urp htdig-3.1.5/htsearch/Display.cc htdig-3.1.5-plural/htsearch/Display.cc
--- htdig-3.1.5/htsearch/Display.cc Fri Feb 25 03:29:11 2000
+++ htdig-3.1.5-plural/htsearch/Display.cc Wed Mar 15 13:17:44 2000
@@ -402,7 +402,7 @@ Display::setVariables(int pageNumber, Li
     else if (mystrcasecmp(config["match_method"], "or") == 0)
         vars.Add("MATCH_MESSAGE", new String("some"));
     vars.Add("MATCHES", new String(form("%d", nMatches)));
- vars.Add("PLURAL_MATCHES", new String(nMatches == 1 ? (char *)"" : (char *)"s"));
+ vars.Add("PLURAL_MATCHES", new String(nMatches == 1 ? (char *)"" : config["plural_suffix"]));
     vars.Add("PAGE", new String(form("%d", pageNumber)));
     vars.Add("PAGES", new String(form("%d", nPages)));
     vars.Add("FIRSTDISPLAYED",

--jesse
--------------------------------------------------------------------
J. op den Brouw Johanna Westerdijkplein 75
Haagse Hogeschool 2521 EN DEN HAAG
Faculty of Engeneering Netherlands
Electrical Engeneering +31 70 4458936
-------------------- J.E.J.opdenBrouw@st.hhs.nl --------------------

Linux - because reboots are for hardware changes

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev-unsubscribe@htdig.org
You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Wed Mar 15 2000 - 07:49:26 PST