Medial T is usually flapped when between 2 vowel sounds. This includes final T when the next word begins with a vowel and we link words. (Final T Linking is discussed here.)
Most words with -ter, -ted, -test, -ting, -ty
better, batter, butter, letter, waiter, writer, water, litter, greater, lighter, wetter
waited, righted, lighted, matted, sighted, fitted,
metabolic, artificial, comforting, dirty, city
greatest, hottest, fatal, hospital, turtle
Medial T (stopped when followed by syllabic n or -ment, -ance, -ly, -m)
Button kitten mittens rotten cotton mountain threaten
Appointment, department, commitment, disappointment, adjustment, treatment
Important, Importance, combatant, pollutant,
Ultimately, infinitely,
Atmosphere
Medial T between 2 vowels (aspirated when second syllable is stressed, other exceptions)
Guitar potato eighteen hotel motel retirement material
Architecture laboratory irritant militant
Medial T (aspirated when not any of the above: in a cluster, not between two vowels)
Distant, Opportunity, transportation, Intonation, enter, interpretation, reputation, representation, concentrate, multi-, sophisticated, documentation, investigate, particular, metro-, consultation, continuation, anticipation
Medial nt words, can sometimes omit t: wanted, Santa Barbara, counter, anti- (eg antibiotic) inter-(eg international), representative, identification, disappointing, advantage