A note dated 16/17 September 2009:
Monosyllabic words have the stress on that one syllable. Example: pais (parents).
If there is an acute accent ('), a circumflex accent (^) or a tilde (~) over a letter, the stress is on that syllable. Examples: útil (useful), país (country), baía (bay).
When the word has both a tilde and an acute or circumflex accent, the tilde does not indicate stress. Examples: sótão (attic), bênção (blessing/benediction), órfão (orphan), côvão (fish trap).
When a tilde is in a syllable before the penultimate syllable, it does not indicate stress. This happens in words with suffixes, e.g. Joãozinho (Johnny), sotãozinho (small attic), irmãmente (sisterly).
Else, if the word ends in a letter a, o or e (after first removing any final s, ns or m), the stress falls on the penultimate (one but last) syllable. Examples: falo, falamos, dia, dias, baia, falam, margem, margens.
All other words bear the stress on the last syllable. Examples: assim, caiu, senti, falei, comer, feliz.
For the same rules described in a different, more complicated way, and with many more examples and special cases, see Livro de Estilo.
Note that the Portuguese words notícia and notícias (message, news) need the accent.
Apart from marking stress, it also turns the last group of letters into a single
syllable: no-tí-cias. Without the accent, the word would have four syllables,
with the last i stressed: *noticias.
Note that there is a difference between Spanish and Portuguese here: in Spanish, the correct pronunciation needs no accent, but the wrong one would. Confer the Spanish names María and Mario, and the corresponding Portuguese names Maria and Mário: same stress pattern in both languages, but different written accents.
To determine the stressed syllable from how a word is
written, it is necessary
to decide what the syllables of the word are. For example, in the word pais
(parents), the ai is supposed to be a single syllable, so the whole word has
only one syllable,
and there is no question where the stress might fall. To get the a and the i
to belong to different syllables, and accent is needed: país (country) has two
syllables, the second of which is stressed.
Confer the name Luís, which does need an accent even though normally a final -is is automatically stressed without a written accent. Apparently without the accent, the name would become monosyllabic, the only syllable being a ui diphthong. Cf. also partiu (left), where iu together make a single, stressed syllable, ciúme (jealousy) and ciumoso (jealous).
Contrary to how it works with "pais" and "país", in a word like raiz (root; plural: raízes) the a and i are supposed to belong to two syllables, even without the accent. The z versus s makes the difference here: words ending in z never have a monosyllabic ai diphthong, so raiz (pronounced ráiz) just can't be a Portuguese word. If it existed, it would be spelled rais.
Other letters having this effect are l, m, n and r if they do not start a next syllable, and also nh. Examples: adail, contribuinte, demiurgo, juiz, paul (marsh, pool, from Vulgar Latin padule), retribuirdes, ruim, rainha ©, tainha, ventoinha, but (because n etc. start a syllable) cafeína, contraí-la, juíza, juízo.
The diphthong ui also doesn't need an accent if it is preceded by a vowel: atraiu, contribuiu, pauis (plural of paul). Cf. pau (stick), one syllable, paul (pool), two syllables, Paulo (man's name), two syllables.
The difference between úi and uí is sometimes relevant for the meaning of words: "fluido" means "fluid" (as a substance), and fluído is the past participle of the verb fluir (stream). Inclui = it includes, incluí = I included.
16/17 September 2009:
Next: Accent marks