Jump to content

සැකිල්ල:ස්ථානය/documentation

Wiktionary වෙතින්
(සැකිල්ල:place/documentation වෙතින් යළි-යොමු කරන ලදි)
Documentation for සැකිල්ල:ස්ථානය. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.
See also Wiktionary:Place names for a list of types of place name of each country.

This template generates definition lines and categories for placenames. The corresponding data module is at Module:place/data.

The basic usage is as follows (e.g. for Germany):

# {{place|en|country|cont/Europe}}.

which generates

  1. A country in Europe.

and places the page in Category:en:Countries in Europe.

The second parameter is the type of the place, while the third and further parameters are holonyms, indicating the larger entities that the place is contained within. Each holonym is of the form TYPE/NAME. The type can be spelled out in full, e.g. continent; common types can also be abbreviated, e.g. cont for continent (as above), s for state, p for province, c for country, etc. The full list of abbreviations is given below.

More than one holonym can be given, e.g. for Toronto:

# {{place|en|city|p/Ontario|c/Canada}}.

which generates

  1. A city in Ontario, Canada.

and places the page in Category:en:Cities in Ontario.

The categorization system automatically generates the correct-format definition and category/categories, even when that requires computing a variant name, e.g. for Amsterdam:

# {{place|en|city|c/Netherlands}}.

which generates

  1. A city in the Netherlands.

and places the page in Category:en:Cities in the Netherlands. In this case, both the definition and category need to have "the" prefixed to the country name, which automatically happens.

As another example, for Pittsburgh:

# {{place|en|city|s/Pennsylvania|c/United States}}.

generates

  1. A city in Pennsylvania, United States.

and places the page in Category:en:Cities in Pennsylvania, USA. (States of the United States are suffixed with , USA in some categories, to aid in distinguishing the US state of Georgia from the country of Georgia.)

For place names in foreign languages, a translation in English can be given, which changes the definition format, e.g. for Allemagne (the French term for Germany):

# {{place|fr|country|cont/Europe|t1=Germany}}

which generates

  1. Germany (a country in Europe)

and places the page in Category:fr:Countries in Europe. (Note that this category has language code fr, which contains French terms for countries in Europe, rather than English terms.)

Some place types use "of" instead of "in" in the definition and category, e.g. for Fairfax County:

# {{place|en|county|s/Virginia|c/United States}}.

which generates

  1. A county of Virginia, United States.

and places the page in Category:en:Counties of Virginia, USA.

Additional descriptive text can be present among the holonyms, and will be formatted correctly in the definition, e.g. for Germany:

# {{place|en|country|in central|cont/Europe}}.

which generates

  1. A country in central Europe.

and places the page in Category:en:Countries in Europe, as above.

Alternative format

[සංස්කරණය]

For complex cases, an alternative format can be used, which freely allows for placetypes and holonyms to be interspersed among raw text, e.g. as follows (for Fener):

# {{place|en|A <<neighborhood>> midway up the <<inlet/Golden Horn>> within <<dist/Fatih>> in <<city/Istanbul>>, <<c/Turkey>>.}}

which generates

  1. A neighborhood midway up the Golden Horn within Fatih district in Istanbul, Turkey.

and places the page in Category:en:Neighborhoods in Turkey.

In this format, placetypes and holonyms are surrounded by <<...>>. The presence of a slash indicates a holonym; no slash indicates a placetype. There is no requirement that placetypes precede holonyms.

In this format, it is possible to break up a multiword placetype if the initial word or words are recognized qualifiers (see below), such as "former" or "ancient". Example:

# {{lb|en|now|historical}} {{place|en|A <<former>> French <<colony>> on the <<isl:pref/Hispaniola>> from 1659 to 1809, roughly equivalent to modern-day <<c/Haiti>>}}.

which generates

  1. (now ඓතිහාසික) A former French colony on the island of Hispaniola from 1659 to 1809, roughly equivalent to modern-day Haiti.

and places the page in Category:en:Historical polities (as <<former colony>> would do), rather than in Category:en:Polities (as <<colony>> would normally do).

Primary parameters:

|1=
the language code of the entry
|2=
see #Placetype parameter
|3=, |4=, |5=, ...
see #Holonym parameters
|t1=, |t2=, |t3=, ...
English translation(s) of the place
|tid1=, |tid2=, |tid3=, ...
sense ID's for the English translation(s) of the place; see {{senseid}}
|cat=, |cat2=, ...
extra categories to add to the page; automatically prefixed by the language code, e.g. |cat=Towns in England will add the page to Category:fr:Towns in England if the specified language code is fr
|sort=
the sort key for the categories generated by the template; rarely needs to be specified, except perhaps for Japanese

Suppression and text parameters:

|def=
replaces the entire definition without affecting the categorization
|also=
adds further text to the type of place without affecting the categorization
|a=
replaces the indefinite article at the beginning of the definition

Extra information parameters:

|modern=, |modern2=, ...
the modern name(s) or location(s) of the place
|official=, |official2=, ...
the official name(s) of the place (e.g. People's Republic of China for China)
|capital=, |capital2=, ...
the capital city/cities of the place
|largest city=, |largest city2=, ...
the largest city/cities of the place
|caplc=
the capital and largest city of the place
|seat=, |seat2=, ...
the seat(s) of the place, particularly for counties and equivalents; displays "county seat", "parish seat" or "borough seat" for counties, parishes and boroughs respectively; otherwise, displays just "seat"
|shire town=, |shire town2=, ...
the shire town (similar to a county seat) of the place, particularly for counties in Vermont

As with holonym parameters (see below), all of these parameters can be prefixed with a language code such as fr:, and prefixing just with : suppresses automatic linking.

Placetype parameter

[සංස්කරණය]

The type(s) of place of the entry, such as city, country or lake. Multiple values are separated by a slash (/). The special value and suppresses the comma and doesn’t affect categorization.

The placetype parameter can be pluralized and will be handled correctly. For example:

# {{place|en|Two <<former unincorporated communities>> in <<co/Williamson County>>, <<s/Illinois>>, <<c/USA>>}}.

displays as

  1. Two former unincorporated communities in Williamson County, Illinois, United States.

and places the page in Category:en:Unincorporated communities in Illinois, USA and Category:en:Unincorporated communities in the United States.

The aliases that are recognized for holonym placetypes (see below) can also be used here and will automatically be expanded, but as a matter of style it is recommended to spell out the placetype in full except for generally-recognized aliases such as CDP for census-designated place.

Holonym parameters

[සංස්කරණය]

A holonym parameter has the following format: placetype/placename. The format placetype/langcode:placename can be used to specify a non-English placename. Normally, the placename will automatically be linked; using : with no langcode suppresses automatic linking. Automatic linking is done exactly as if {{l}} were being used, which means that square brackets can be used inside it to link to individual parts, and {{w}} can be used to link to Wikipedia.

If the placetype and following slash are omitted, the parameter is displayed as regular text.

If there are multiple holonyms, commas are placed before all holonyms except the first, according to the following algorithm:

  1. No comma is placed before the first holonym (whether a placename or raw text).
  2. No comma is placed before a holonym (whether a placename or raw text) preceded by raw text.
  3. No comma is placed before the special raw-text values and and in.
  4. A comma is placed before all other holonyms.

This does not apply to the alternative format described above, where raw text, placetypes and placenames are freely interspersed and no extra commas are added unless multiple placenames are grouped together (see below).

Grouped holonyms

[සංස්කරණය]

Multiple comma-separated placenames can be given, and are formatted correctly and individually linked. For example:

  1. {{place|en|river|c/Ukraine,Belarus,Poland}}.
    A river in Ukraine, Belarus and Poland.
  2. {{place|en|Several <<cities>> in <<c/Argentina,Chile,Philippines,Spain,United States>>}}.
    Several cities in Argentina, Chile, Philippines, Spain and the United States.

Holonyms that take "the"

[සංස්කරණය]

Some holonyms are normally preceded by "the", as in "the United States", while others aren't, e.g. "France". Holonyms that are normally preceded by "the" will have this added if they occur either as (1) the first-specified holonym parameter; (2) the non-first holonym in a multi-holonym list (for this, see the example just above); (3) when accompanied by the :pref or :Pref modifiers (see below). In other positions, they will not be preceded by "the", e.g.:

  1. {{place|en|city|in the southern|c/United States}}.
    A city in the southern United States.
  2. {{place|en|city|s/Georgia|c/United States}}.
    A city in Georgia, United States.

Holonym placetype aliases

[සංස්කරණය]

Several aliases are recognized for placetype:

  • ccountry
  • rregion
  • pprovince
  • sstate
  • ccconstituent country (should be used for England, Scotland, and Wales)
  • contcontinent
  • deptdepartment
  • distdistrict
  • rivriver
  • careacouncil area
  • cdp, CDPcensus-designated place

[etc.]

The full list can be found below under Recognized placetypes, which lists all recognized placetypes along with the aliases (if any) of each placetype.

Holonym placetype modifiers

[සංස්කරණය]

Following the holonym placetype can be a colon followed by one or more comma-separated modifiers, e.g. s:suf/New York. Currently, the following modifiers are recognized:

  • suf: Display the full placetype as a lowercase suffix, e.g. s:suf/New YorkNew York state.
  • Suf: Display the full placetype as a capitalized suffix, e.g. s:Suf/New YorkNew York State.
  • pref: Display the full placetype as a lowercase prefix, e.g. s:pref/New York(the) state of New York (the initial "the" is displayed in the same circumstances as when it is displayed before a holonym like "United States"; see above).
  • Pref: Display the full placetype as a capitalized prefix, e.g. s:Pref/New York(the) State of New York (the initial "the" is displayed in the same circumstances as when it is displayed before a holonym like "United States"; see above).
  • noaff: Suppress the default display of a prefix or suffix (see below).

The reasons for using such a modifier are that (a) category recognition code is based off the full holonym placename, and hence won't work properly if a holonym like s/[[New York]] State is used; and (b) the bare holonym without the prefix or suffix will be autolinked, without the need to explicitly inserted brackets around the bare holonym.

Note that some holonym placetypes have prefixes or suffixes attached by default, e.g.:

  • "canton", "civil parish", "community development block", "council area", "county borough", "department", "district", "district municipality", "local government district" (suffixed with "district"), "London borough" (suffixed with "borough"), "parish", "peninsula", "subdivision", "tehsil" (suf)
  • "autonomous oblast", "autonomous okrug", "census area", "krai", "oblast", "okrug", "regional county municipality" (Suf)
  • "metropolitan borough", "municipal district", "regional district", "regional municipality", "rural municipality" (Pref)

This affixing does not happen if the holonym placename already has the placetype or a part of it in it, if an explicit prefixing or suffixing modifier is used, or if the modifier noaff is used.

Examples:

  1. {{place|en|city|carea/Highland|cc/Scotland}}.
    A city in Highland council area, Scotland.
  2. {{place|en|capital city|c:pref/Georgia}}.
    The capital city of the country of Georgia.

Multiple descriptions

[සංස්කරණය]

The special value ; restarts the description and categorization (except for the language code), and joins the two descriptions with a semicolon. For example:

  1. Rio de Janeiro
    {{place|pt|city/state capital|s/Rio de Janeiro|c/Brazil|;|former capital city|of|c/Brazil}}
    a city, the state capital of Rio de Janeiro, Brazil; the former capital city of Brazil

The main reason to use this format, as opposed to simply stringing the entire description together, is that categorization is restarted. This allows for more flexible categorization of places that serve multiple functions than would otherwise be possible.

More generally, any value beginning with a ; and not immediately followed by a space has the same restarting behavior, and in addition the text after the semicolon serves as the joining text, in place of a semicolon. For example:

  1. Vatican City
    {{place|en|city-state|r/Southern Europe|;,|an <<enclave>> within the city of <<city/Rome>>, <<c/Italy>>}}
    A city-state in Southern Europe, an enclave within the city of Rome, Italy.

If the joining text begins with an ASCII or Unicode letter, a space is placed before the joining text, otherwise no space is added, as above. Finally, the special value ;; joins the descriptions with only a space.

More complex examples

[සංස්කරණය]
  1. Scranton
    {{place|en|city|in northeastern|s/Pennsylvania|c/United States}}.
    A city in northeastern Pennsylvania, United States.
    (adds Category:en:Cities in Pennsylvania, USA)
  2. Italy
    {{place|en|country|in southern|cont/Europe|caplc=en:Rome}}.
    A country in southern Europe. අගනුවර සහ විශාලතම නගරය: Rome.
    (adds Category:en:Countries in Europe)
  3. Roma
    {{place|it|capital city|c/Italy|t1=Rome}}.
    Rome (the capital city of Italy).
    (adds Category:it:Capital cities)
  4. Wavrin
    {{place|fr|village/and/municipality|dept/Nord|r/fr:[[Nord-Pas-de-Calais]] region|c/France}}.
    a village and municipality of Nord department, Nord-Pas-de-Calais region, France.
    (adds Category:fr:Villages in France and Category:fr:Municipalities of France)
  5. Bernicia
    {{place|en|a=An Anglo-Saxon|kingdom|in northeastern|c/England|and|southeastern|c/Scotland}}.
    An Anglo-Saxon kingdom in northeastern England and southeastern Scotland.
    (adds Category:en:Polities, for lack of a more specific category)
    {{place|en|An Anglo-Saxon <<kingdom>> in northeastern <<c/England>> and southeastern <<c/Scotland>>.}}
    An Anglo-Saxon kingdom in northeastern England and southeastern Scotland.
    (same as previous example, using the alternative format)

Guide to adding new items to the data module

[සංස්කරණය]

Module:place/data controls the categorization of entries and some issues concerning the wording of definitions. This section will show, as an example, how to change the categorization and display of archipelagos.

Each index of the variable export is a placetype. You can begin by adding the item

["archipelago"] = {
},

Each item has subitems for individual countries and one called "default". These subitems have subsubitems that indicate whether the entry should be categorized under the given holonym. The special index of "itself" indicates that the entry is categorized without a holonym. For example, if we add the following code:

["archipelago"] = {
	["country/Indonesia"] = {
		["province"] = {true},
		["country"] = {true},
	},
	["default"] = {
		["itself"] = {true},
	},
},

Then entries for archipelagos in Indonesia will be categorized under Category:langcode:Archipelagos in Province, Indonesia, or Category:langcode:Archipelagos in Indonesia if a province is not provided. For all other countries, or when no country is given, the entry will be added to Category:langcode:Archipelagos.

Instead of true, you can use a string to replace the word Archipelagos in the category. For example, if in the default subitem you used instead

		["itself"] = {"Islands"},

Then archipelagos outside of Indonesia would be added to Category:langcode:Islands

If the type of place requires wording more complicated than “place A, place B, place C, [] ”, a variable called synergy= can be used. Each subitem of this variable is the type of place that precedes it, and has the variables before=, between= and after=.

	synergy = {
		["island"] = {
			before = "in the island of",
			between = "in the",
			after = "archipelago"
		},
	},

This would make {{place|en|village|island/Komodo|archipelago/Lesser Sunda}} generate “A village in the island of Komodo in the Lesser Sunda archipelago.”

The other variables are:

preposition=
Replace the default preposition "in" in definitions and categories (e.g. “A department of France” instead of “A department in France”).
plural=
Replace the default plural in categories (e.g. “Kibbutzim in Israel” instead of “Kibbutzes in Israel”). The default pluralizing algorithm is very smart and almost always works (e.g. city -> cities, valley -> valleys, parish -> parishes, pass -> passes, commonwealth -> commonwealths), so this is rarely necessary.
article=
Replace the default article "a"/"an" in definitions when occurring as the entry placetype (e.g. “The capital of” instead of “A capital of”). The value will almost always be "the".
holonym_article=
Specify an article to add to holonyms containing this placetype (e.g. riv/Nile -> "the Nile" instead of just "Nile").
affix_type=
Specify that holonyms containing this placetype will automatically have a prefix or suffix added, as described above under #Holonym placetype modifiers. Possible values are pref, Pref, suf and Suf.
affix=
Specify the affix to use in conjunction with affix_type=, instead of using the placetype itself (e.g. "local government district" specifies affix="district").
no_affix_strings=
Used in conjunction with affix_type=; specifies a string or list of strings which, if occurring in the holonym, will disable automatic affixation. Defaults to the placetype itself. Matching is case-insensitive. For example, "autonomous okrug" specifies no_affix_strings="okrug" (so that if "okrug" or "Okrug" occurs in the holonym, it will disable affixing), and "district municipality" specifies {"district", "municipality"} (so that if either "district" or "municipality", capitalized or lowercase, occurs in the holonym, it will disable affixing).
display_handler=
Specify a function to control the display of the holonym. Passed two arguments, the holonym placetype and placename, and should return the string to display.
cat_handler=
Specify a function to control the categorization of the holonym. Passed three arguments, the holonym placetype and placename and the full place spec that describes all facets of the place description (described in more detail in the comments to Module:place). Should return a table such as { ["itself"] = {"Cities in Nicaragua"} }, i.e. in the same format as the innermost table in the holonym's category spec, as described above.

Recognized placetypes

[සංස්කරණය]

The following placetypes are recognized by the module, and processed specially. This does not mean that other placetypes cannot be used, but they will not get special handling (e.g. their display form will not be linked and they will not trigger any categorization).

Lua දෝෂය in Module:place/data at line 1246: bad argument #1 to 'ipairs' (table expected, got nil).

Recognized placenames

[සංස්කරණය]

The following place names are recognized by the module, and handled specially in some fashion. Note that there's nothing preventing any place name from being used. Note that items in the third and fourth columns are boldfaced if they are different from the placename in the first column.

Lua දෝෂය in Module:place/data at line 1246: bad argument #1 to 'ipairs' (table expected, got nil).

Recognized qualifiers

[සංස්කරණය]

The following qualifiers are recognized by the module. This means that if such a qualifier is used before a recognized placetype, the placetype will still be recognized and processed as normal. Note that items in the second column are boldfaced if they are different from the qualifier in the first column.

Lua දෝෂය in Module:place/data at line 1246: bad argument #1 to 'ipairs' (table expected, got nil).

"https://si.wiktionary.org/w/index.php?title=සැකිල්ල:ස්ථානය/documentation&oldid=82912" වෙතින් සම්ප්‍රවේශනය කෙරිණි