This verse consists of two sentences. The first two lines form the first one and the second line contains the second one. The first sentence can be subdivided into two sentences. 1) nidhīnaṃ va pavattāraṃ yaṃ passe vajjadassinaṃ niggayhavādiṃ medhāviṃ (should one see an intelligent person, who speaks rebukingly who can see faults as if showing treasures). The subject is omitted; any personal pronoun can be implied. The verb is passe (one should see, 3rd person, singular, active, optative). The main object is the relative pronoun yaṃ (whom, accusative singular). This object has three attributes: medhāviṃ (intelligent one, accusative singular), niggayhavādiṃ (speaking rebukingly, accusative singular) and vajjadassinaṃ (seeing faults, accusative singular). This last word has an attribute clause, nidhīnaṃ va pavattāraṃ (like showing treaures). Here the main attribute is pavattāraṃ (one who shows, accusative singular). It has the noun nidhīnaṃ (of treasures, genitive plural) as an attribute. The particle va (like) connects the clause to the word vajjadassinaṃ. 2) tādisaṃ paṇḍitaṃ bhaje (one should associate with such a wise one). Again, the subject is omitted. The verb is bhaje (one should associate, 3rd person, singular, active, optative). The object is paṇḍitaṃ (wise one, accusative singular) with its attribute, the adjective tādisaṃ (such, accusative singular). In the second sentence, the subject is the adjective seyyo (better, nominative singular). The noun pāpiyo (worse, nominative singular), negated by the negative particle na (not), forms an attribute to the subject. The verb is hoti (is, 3rd person, singular, active, indicative, present tense). The object is the medium present participle bhajamānassa (of the one who associates, genitive singular) with the adjective tādisaṃ (such, accusative singular) as an attribute.
A poor old man named Rādha was staying in the monastery doing manual work, like sweeping, cutting the grass etc. He wanted to become a monk, but the elders were not willing to admit him. One day the Buddha saw that Rādha had a potential to become an arahant, so he called the monks and asked them if any of them recollects a good deed done by Rādha. Venerable Sāriputta said that Rādha once offered him some rice. The Buddha then asked if it wasn't proper to repay the kindness by accepting the man into the Order and show him the way out of suffering. So Rādha became a monk under Venerable Sāriputta. He strictly followed Sāriputta's guidance and in a very short time he attained arahantship. When the Buddha heard about this he explained by this verse that a monk should always be attentive to guidance by his betters and not resent rebukes for his faults.