Template:pt-IPA/documentation

Introduction
Usage:

Pronunciation
or:

Pronunciation
In cases when the template is not capable of generating the correct pronunciation, you can explicitly state the dialects:

Pronunciation
The module can accommodate multiple pronunciations for a given dialect:

Introduction
The general principle behind this module is to allow a single respelling to be used as much as possible for both Portugal and Brazil, despite the dramatic differences in pronunciation between the two dialects. To support this, various symbols are defined that have an effect in only one of the two dialects.

For example, unstressed a e o in Portugal are normally pronounced as reduced vowels, but sometimes as open vowels , and sometimes (less frequently) as close vowels. The corresponding words in Brazil are usually pronounced with full vowels regardless of the particular quality in Portugal. To support this, unmarked symbols  request the default unstressed pronunciation (usually reduced), while we provide special symbols   to indicate unstressed open vowels in Portugal and special symbols   to indicate unstressed close vowels in Portugal. All three sets of symbols map to the same pronunciation in Brazil.

Conversely, in Brazil there are frequently multiple ways of pronouncing unstressed vowels in hiatus (i.e. directly before another vowel), where a single word often admits multiple pronunciations, while in Portugal these are fairly consistently pronounced as glides. We provide various symbols to support the variation in Brazil, which all map to glides in Portugal.

Various specific situations are described in more detail below.

Indicating vowel quality

 * Acute accent  indicates stressed vowels, and in addition, in combination with non-high vowels   indicates an open quality.
 * Circumflex accent  indicates stressed close vowels.
 * Grave accent  indicates unstressed open vowels  in Portugal but has no effect in Brazil.
 * Dot-under  indicates unstressed open vowels  in both Portugal and Brazil (e.g. in fofoca, forrobodó respelled ,  ).
 * Macron  indicates unstressed close vowels  in Portugal but has no effect in Brazil. Note that   is rarely necessary, but is useful in cases like saudade respelled.
 * Dot-under + circumflex  indicates unstressed close vowels  in both Brazil and Portugal; however, this should rarely be necessary, as unstressed  are the default in Brazil.

In most circumstances, vowel quality must be indicated on any stressed  or  ; if not, an error will be thrown. The following are the exceptions where this is not necessary: Stressed a defaults to open unless directly followed by a nasal consonant (m, n or nh), in which case it defaults to close, as in cama.
 * 1) When followed by a nasal consonant, regardless of whether this nasal consonant is in turn followed by a vowel. In this case, the vowel quality defaults to close. For example, lenha, mente and bom respelled as-is are interpreted as if respelled  ,   and.
 * 2) In a diphthong  . These are as if respelled , in keeping with their most common interpretation.
 * 3) For o specifically, if it is directly followed by another vowel, in which case it defaults to close. For example, boa and voo respelled as-is are interpreted as if respelled   and.
 * 4) In the common suffixes ,  ,   and their corresponding feminine and plural forms, where the   defaults to close.
 * 5) In the common suffix , where the   defaults to close. The corresponding feminine and plural suffixes  ,   and   are also handled automatically, but in these cases the   defaults to open, as the suffix is.

Nasalization

 * Tilde  can be used to indicate a nasalized vowel, as in standard Portuguese spelling. Some properties of nasalized vowels:
 * Nasalized vowels are pronounced close (as if written with a circumflex accent) unless specifically indicated as open using.
 * Nasal diphthongs  have special handling, as in standard Portuguese spelling.
 * Nasalized vowels written with a tilde are normally stressed, but an explicit acute or circumflex accent elsewhere takes precedence (as in bênção, or respellings such as  for one possible Portugal pronunciation of Benjamim).
 * As with standard Portuguese spelling, nasalized vowels can also be indicated using  or   followed by a consonant, or   at the end of a word. In Brazil,   at the end of a word also indicates nasalization, but it indicates  in Portugal without nasalization of the preceding vowel. Use   in respelling to indicate coda, and   to indicate coda.

Stress assignment
The following should be noted (all of which is consistent with standard Portuguese spelling rules):
 * Primary stress on a word can be indicated by placing an acute accent or circumflex on the stressed vowel. The choice of accent indicates the quality of the vowel in the case of a e o, while an acute accent should always be used on i u. See above for the specifics of vowel quality.
 * Nasal vowels indicated with a tilde (see above) bear primary stress in the absence of an acute or circumflex accent elsewhere in the word. In the case of multiple tildes in a single word (e.g. pãozão, aviãozão), the last vowel with tilde bears the primary stress.
 * In the absence of any acute accent, circumflex or tilde, the standard stress assignment rules apply. Approximately speaking, the following final syllables are unstressed: -a -e -o -as -es -os -am -em -ans -ens. If a word ends in any of these sequences, the second-to-last syllable bears primary stress; otherwise the last syllable bears primary stress.
 * Epenthetic syllables in Brazil involving spelled using ,   or  , such as in  respelled   and  respelled  , do not affect stress assignment. Effectively, the stress assignment algorithm behaves as if the syllables are not present.

In addition, the following special rules apply:
 * If there are multiple primary stresses indicated, all but the last are converted to secondary stress. This is the standard way of notating secondary stress in a word; in particular, a grave accent does not indicate secondary stress (see above).
 * In the rare circumstance where the above rule does not suffice for secondary stress (e.g. if the secondary stress comes after the primary stress), use line-under to explicitly indicate secondary stress: . The quality of a e o marked in this fashion is open . To indicate close, use.
 * There is special handling of the suffixes, and . Essentially, these endings automatically have a   inserted before them (see below for the exact meaning of this separator). This means that both the suffix and the preceding component get primary stresses assigned, and that an explicit primary stress on the preceding component does not indicate primary stress on the entire word, but only on that portion (which is eventually converted to secondary stress by the rule above about multiple primary stresses). This means, for example, that the respelling   for facilmente does not indicate primary stress on the a, but rather secondary stress, with primary stress on the first e in . Similarly, a respelling like   for abertamente will throw an error, as the first e bears stress but does not have its quality indicated; a respelling like   must be used. To defeat this behavior, add an explicit accent on the suffix. For example, dormente should be respelled  , and vizinho should be respelled.

Symbols indicating other Brazil-Portugal differences (vowel raising, glides, epenthesis)

 * The symbol  indicates an epenthetic unstressed /i/ in Brazil (and has no effect on determination of the stressed vowel) but no vowel in Portugal.
 * The symbol  not preceding or following a vowel indicates either an epenthetic unstressed /i/ in Brazil or no vowel (but still causes palatalization of /t/ and /d/) and indicates no vowel in Portugal.
 * The symbol  preceding or following a vowel indicates either an unstressed /i/ in hiatus or a /j/ in Brazil and is the same as   in Portugal. Note that the behavior of   preceding a vowel is actually the default currently for handling   in hiatus in Brazil. Using   following a vowel is principally useful in the sequence  . This maps to either   or   in Brazil but to   in Portugal (which ends up pronounced ). This gives the correct pronunciation for words like.
 * The symbol  is like   (in both meanings) but with the two possibilities listed in the opposite order.
 * The symbol  indicates either an unstressed /u/ in hiatus or a /w/ in Brazil and is the same as   in Portugal.
 * The symbol  is like   but with the two possibilities listed in the opposite order.
 * The symbol  indicates either an unstressed   or   in Brazil and is the same as   in Portugal.
 * The symbol  is like   but with the two possibilities listed in the opposite order.
 * The symbol  indicates either an unstressed   or   in Brazil and is the same as   in Portugal.
 * The symbol  is like   but with the two possibilities listed in the opposite order.
 * The symbol  at the beginning of a word or component indicates either   or   in Brazil and is the same   in Portugal.
 * The symbol  is like   but with the two possibilities listed in the opposite order.
 * The symbol  is like   in Brazil but   in Portugal. This is useful especially before nasal consonants, e.g.  respelled.
 * The symbol  is like   in Brazil but   in Portugal. This is useful especially in the diphthong ei, e.g.  respelled.
 * The symbol  is like   in Brazil but   in Portugal. This is useful especially before nasal consonants, e.g.  respelled.
 * The symbol  is like   in Brazil but   in Portugal. This is useful especially in the diphthong oi, e.g.  respelled.

Some mnemonics to help you remember these codes:
 * 1)   indicates that there are two possible outputs in Brazil, the first of which is generally the same as the vowel directly preceding. For example, the first possible output for   and   in hiatus is  and  respectively. Similarly, the first possible output for   and   is  and  respectively.
 * 2)   is the same as   but the two outputs are given in opposite order.
 * 3)   indicates a single output in Brazil that differs from the corresponding Portugal output, where the Brazil output is always the vowel exactly as written. Hence,   means  in Brazil (and nothing in Portugal). Similarly,   mean exactly those vowels in Brazil, but the "height-opposite" vowels in Portugal.

Multiple components of a word

 * Use  to treat several components of a word as separate words. Each component is normally assigned its own stress (although all but the last stress will be converted to a secondary stress, consistent with handling of multiple word stresses elsewhere), and letters at component boundaries are treated as if at word boundaries. This follows standard Portuguese spelling practices; compare arco-íris, batata-da-terra, etc.
 * is similar to  but a few word-final transformations do not apply to the component preceding the  ; for example, in Brazil, written   in this position is  not, and optional  insertion after a stressed vowel and before /s/ does not apply. This is intended for suffixes like , /, , etc., which require this behavior. Note that ,  and  automatically add   before them; but you will need to manually add it in words like cafezeiro (respelled  ), boazona (respelled  ), etc.
 * is somewhat like  and , but final -o and -e in the preceding component are not raised to  and  respectively in Brazil, as they are with   and  . This is useful especially for prefixes with secondary stress, e.g. eletrodoméstico respelled  ; idiossincrasia respelled  ; antiferromagnético respelled  . Note that in words like these, the final -o of the prefix is frequently pronounced  in Portugal and requires   for this reason.
 * can be used before suffixes like and, and behaves like   but with the following differences: (1) sress on the component preceding   is undisplayed rather than being converted into secondary stress; (2) syllabification is transparent to  . Hence e.g. rapazinho can be respelled  , and vozinha can be respelled  , and the correct pronunciation will be generated.
 * is like  but no stress assignment happens at all to the component preceding it. It is intended for unstressed prefixes such as ; letters at the beginning of the following component will be treated as word-initial. In fact, the special notation   uses   internally.

Other symbols

 * stands for the pagename (see example above).
 * indicates an optional hiatus in both Portugal and Brazil, as in respelled  . In this example, this respelling is equivalent to writing   for both Portugal and Brazil. (This differs from the symbol combinations written above using   and , which apply only to Brazil.)
 * Use  to indicate an explicit syllable division, particularly between vowels, as in  respelled  . Under normal circumstances, do not use this to override the default syllabification algorithm; instead, contact User:Benwing2 to suggest changes to that algorithm.
 * after  and   before a front vowel  indicates that the   should be pronounced as  rather than being silent, as in  respelled  and  respelled.
 * Use  to separate multiple possible pronunciations. Note, however, that this is only recognized if no space follows the comma; otherwise, the comma is considered to be embedded in the respelling and is treated as a foot boundary, as in.

Inline modifiers
You can attach inline modifiers to a given pronunciation using the format. For example, to attach a qualifier colloquial to a given pronunciation, use a syntax as follows (for ):

pt-IPA

which generates

Note how the Brazil pronunciation with respelling  is tagged as colloquial. Currently the following inline modifiers are recognized:

An example of using a reference is with :

Prefixes and suffixes
Prefixes (words ending in a hyphen) are always treated as lacking primary stress. Any stressed vowels are given secondary stress. Suffixes (words beginning with a hyphen), however, are usually stressed as normal. To specify the pronunciation of an unstressed suffix such as or, put a dot over the vowel that would be stressed, using the symbols. For example, for, use

-fȧgo

which generates

Note the lack of a stress marker and the occurrence of in Portugal.

Deduplication
If the same pronunciation is generated twice for a given dialect (including with the same qualifiers and references, if any), only the first occurrence is displayed. This is useful, for example, when there are two Portugal pronunciation variants but only one Brazil pronunciation, such as for ; use

hèmorragia,+

which generates

Here,  expands to the pagename , which differs from the first respelling only in the latter having   instead of. Both variants map to the same sound in Brazil, so the two Portugal variants end up pronounced the same and are deduplicated.

Epenthetic /i/ in Brazil
Brazilian Portuguese is known for having an unwritten epenthetic inserted to break up difficult-to-pronounce consonant clusters. A well-known example is, frequently pronounced as if written adivogado. Words with epenthetic often admit alternative pronunciations where the vowel is not pronounced on the surface (but is still present in a latent sense because it triggers palatalization of  to ). To indicate such a vowel, use one of the following symbols (all of which generate no vowel in Portugal dialects):
 * If the vowel is always present
 * If the vowel is always present, use . This is typically the case, for example, with mn clusters such as in, which are not normally supported in Brazil (and in fact are one source of spelling differences between Brazil and Portugal, cf. Portugal , spelled  in Brazil). (Another such cluster is brr, such as in .) For example, for , write

gimi*nòspérma

which generates

Here  specifies a mandatory epenthetic  in Brazil that is not present in Portugal; meanwhile,   specifies an unpredictable unstressed open  that is not present in Brazil (which has normal ).

Similarly for, write

abi*rrogação

which generates


 * If the vowel is usually present, but sometimes isn't
 * If the vowel is usually present, but sometimes isn't, use . This is the case for most consonant clusters where the second consonant is a stop, fricative or nasal, i.e. any consonant other than, single  , or a glide  or . (There are a few exceptions; see the next item.) An example is ; write

pi^neu

which generates

Another example of note is ; write

dighi^no

which generates

Two things should be noted here. One is the use of  to get hard ; this is the recommended way of respelling in this situation. ( would not work for Portugal, where the respelling   would be generated.) Similarly for a cluster with , use respelling with  , e.g. respell  as. The other is the lack of a stress mark in the respelling. This is because the epenthetic that is generated is ignored for stress assignment purposes (but is treated as a normal vowel for all other purposes, e.g. palatalization of , softening of  , and syllabification).


 * If the vowel is usually not present, but sometimes is
 * If the vowel is usually not present, but sometimes is, use . This happens commonly with, , ,  and  clusters (exceptions are  and  clusters followed by another consonant, such as ).

Vowels in hiatus
A hiatus is an occurrence of two vowels next to each other with no consonant between them. (In Portuguese, diphthongs such as au ei õe are not normally considered instances of hiatus, but instead of considered single phonemes.) The current treatment of hiatuses is as follows:
 * In Portugal, an unstressed e or i directly followed by another vowel is treated as a glide . Likewise an unstressed o or u directly followed by another vowel is treated as a glide . An exception is the sequences  (as in ateísta, veículo, etc.) and   (as in europeizar respelled  ), which are treated as if spelled   and , respectively, consistent with normal Central Portugal pronunciation.
 * In Brazil, all vowels in hiatus are currently treated as-is, so that e.g.  renders as  and   renders as . This is subject to change. To explicitly notate a glide, use   or  . To explicitly notate a hiatus, put a   between the vowels. To notate multiple possibilities, use circumflex symbols as described above.

Special handling of certain consonants in certain contexts

 * "Coda " (i.e. written   when not occurring before a vowel) generates  in Brazil and  in Portugal.
 * Before coda  in Portugal, vowels generally have an open pronunciation, even when unstressed. Specifically,   becomes, as in ;   becomes , as in  and ; and   generates two outputs,  and  (representing regional and per-speaker variation), as in.
 * Before coda  in Portugal, vowels generally have an open pronunciation, even when unstressed. Specifically,   becomes, as in ;   becomes , as in  and ; and   generates two outputs,  and  (representing regional and per-speaker variation), as in.


 * The pronunciation of written  varies greatly between Brazil and Portugal and within different dialects in each case.
 * There are three varieties of, which we will term strong  , weak   and coda  . Strong   and weak   contrast between vowels, where strong   is written as double   whereas weak   is written as single  , as in e.g.  vs. . Elsewhere, only one variety occurs. Specifically, strong and weak   only occur before vowels, while coda   occurs elsewhere (before a consonant or at the end of a word). Strong   occurs at the beginning of a word, as well as after a nasal vowel (as in ), an   (as in ), and an   (as in ). Weak   occurs after all other consonants.
 * The following generalizations describe the most common pronunciation of strong, weak and coda :
 * Weak  is a flap  everywhere.
 * Strong  is usually a guttural sound, conventionally notated as  in phonemic notation. In Portugal, this actually corresponds to the normal pronunciation, but in Brazil this conventional notation (even though we follow it) is highly misleading as it does not at all represent the actual pronunciation of this sound in most dialects. Rather, the most common pronunciation is  (sometimes a uvular , as in Rio de Janeiro). Hence, we use  as the phonetic representation of strong   in "general Brazilian".
 * Coda  is pronounced the same as weak   in Portugal and some Brazilian dialects (e.g. standard São Paulo city), but the same as strong   in most Brazilian dialects; this is what we use for "general Brazilian". Meanwhile, some Brazilian dialects have a unique sound for coda   that is different from both strong and weak  . For example, the typical "Caipira" accent (found in several rural areas of Brazil) uses an American R, while São Paulo state tends to use a British R.
 * Coda  in Brazil following any of the stressed vowels  is by default written as optional, i.e.,  or the like. This expresses the fact that most such words are verbs, and coda   in verbs is frequently omitted. This does not apply to non-verbs, which must be respelled with   to prevent this. For example, ,  and  should be respelled  ,   and   respectively.
 * Before word-final  in Portugal, unstressed vowels are rendered as open, representing their most common pronunciation, as in , , . This also applies before a component boundary; in particular, prefixes , ,  respelled  ,  ,   automatically get  before the final.
 * Before word-final  in Portugal, unstressed vowels are rendered as open, representing their most common pronunciation, as in , , . This also applies before a component boundary; in particular, prefixes , ,  respelled  ,  ,   automatically get  before the final.

The letter  can have multiple possible pronunciations.
 * Between non-nasal vowels (including across a word boundary), single  is  while double   is . Hence the   in  is ; likewise the first   in.
 * Elsewhere before a vowel,  is normally, e.g. word-initially as in  or after a consonant as in . This includes when following a nasal vowel, as in . An exception is in  , as in  or , where it is.
 * When not before a vowel,  is either a hissing sound  or a hushing sound, depending on the dialect; Portugal and Rio de Janeiro dialects use hushing sounds, while other Brazilian dialects use hissing sounds. Voiced sounds  occur before voiced consonants, while unvoiced sounds  occur elsewhere. An exception is word-initially before a consonant, where  occurs even in Portugal and Rio. All such words are borrowings, often unassimilated or semi-unassimilated, e.g.  and.
 * To force where it would not normally occur, use.
 * Note also that the sequence  represents, as in English.

Written  has multiple possible pronunciations in Portuguese:  (as in, ),  (as in ),  (as in ) or  (as in ). Sometimes the same word can have two different pronunciations of, as in , pronounced. The module handles this by defaulting to specific pronunciations in specific circumstances, and requiring respelling in all other cases. Specifically:
 * Initial  defaults to, as in , ,.
 * Final  defaults to, as in , ,.
 * following a diphthong defaults to, as in , ,.
 * Non-final  in the sequence   defaults to, as in ,.
 * The sequence  followed by a consonant has special handling. The   is pronounced as if written , and the entire sequence   in Portugal is pronounced as if written  . This still applies in written   or  . Examples: , ,.
 * In all other circumstances,  must be respelled ,  ,  ,   or similar; otherwise an error results.
 * NOTE: When respelling  to generate the sound, it is recommended to use the respelling  , not  , because in the future an additional pronunciation line may be added for the Northeast Portugal dialect, where   is pronounced as  and the words  and  form a minimal - pair.

Special handling of certain vowels in certain contexts

 * Initial unstressed  and   in Portugal are normally . This also applies after component boundaries such as those indicated by.
 * Unstressed  and   in Portugal, as in  and, are normally.

Other comments

 * Under some circumstances, multiple pronunciations are output even when a single respelling is provided. This happens in the following circumstances:
 * When any of the symbols described above that use a circumflex character  are used (only in Brazil).
 * In Brazil, when a word begins with unstressed en- or em- followed by a consonant. The two outputs have (indicated as careful pronunciation) and  (indicated as natural pronunciation).
 * In Brazil, when a word begins with unstressed es- or ex- followed by a consonant (except in cases like ). The two outputs have and, representing regional and per-speaker variation.
 * In Portugal, when a word has a stressed in hiatus (directly followed by another vowel). In this case, the second output has a  inserted and is marked regional. For example,  ends up outputting  and, with the second marked as regional.
 * In Portugal, when the sequence is found (as in ). The two outputs have  (indicated as careful pronunciation) and  (indicated as natural pronunciation).
 * In Portugal, when unstressed ol occurs followed by a consonant or word boundary. The two outputs have and, representing regional and per-speaker variation.

Warning
This template is still being developed and is liable to change.
 * Click preview before adding a usage of this template to an article in the main namespace.
 * Do not automatically add usages of this template to articles in the main namespace.
 * Report any mistake to User:Benwing2.