Sanskrit has an elaborate set of phonological rules called sandhi and samāsā which are expressed in writing (except in so-called pada texts). Sandhi refers to combination of words when they are spoken with each other without a gap. Since the word scheme is based on pronunciation, this is no exception. Sandhi rules define how the entire word or phrase sounds when two words are combined or merged. Almost always, the new word sounds like the two words spoken one after other except for euphonic changes at the point where the first word ends and the second one starts. This change depends on the sound with which the first word ends and the sound with which the second word starts. These sounds also form the basis of classification of sandhis. The effects of Sandhi have been carefully observed and described, leading to codified rules of combination. For example, when saying one word ending in i followed by another starting in u, these will be combined into yu.
These sandhi rules are not always obeyed in the Vedas.
Samāsa is a combination of two or more words, or sometimes even a phrase, like 'newborn' is for 'newly born'. The meaning of a samāsa is normally clear from the samāsa itself, though some of the samāsa have a meaning very different from their constituent words. These are normally used to refer to some personality, deity or thing by one of its well known characteristics. samāsa are also categorized according to the kind of meaning they have and the constituent word that dominates the meaning. Samāsa plays a key role in many cases, especially in certain expressions. Samāsa does not have any distortion in the words, although sometimes prefixes and suffixes are used to impart a certain type of meanings to the words. A sandhi always consists of two meaningful words while all constituent words of a samāsa may not be meaningful individually. A sandhi may be difficult to understand for a person who is inexperienced in Sanskrit or has a poor vocabulary. It is same with samāsa, but they are much easier to understand as they are mostly used in some fixed formats and meanings. Sandhi and samāsa add beauty to the language and are extensively used by poets. When a sandhi can be broken in more than one way or a samāsa can be interpreted in more than one way, they can be used as puns. There are many examples of such uses in Sanskrit literature.