In most cases the differentiation between the gerund and the participle does not present any difficulty.
Unlike the participle the gerund may be preceded by a preposition, it may be modified by a noun in the possessive case or by a possessive pronoun; it can be used in the function of a subject, object, and predicative. In the function of an attribute and of an adverbial modifier both the gerund and the participle may be used,, but the gerund in these functions is always preceded by a preposition.
There are cases, however, when the differentiation between the’ gerund and the participle presents some difficulty; for instance, it is not always easy to distinguish between a gerund as part of a compound noun and a participle used as an attribute to a noun. One should bear in mind that if we have a gerund as part of a compound noun, the person or thing denoted by the noun does not perform the action expressed by the ing-form: e. g. a dancing-hall (a hall for dancing), a cooking-stove (a stove for cooking), walking shoes, a writing-table, etc.
If we have a participle used as an attribute the person denoted by the noun performs the action expressed by the ing-form:e. g. a dancing girl (a girl who dances), a singing child, etc.
However, there are cases which admit of two interpretations; for example a sewing machine may be understood in two ways: a machine for sewing and a machine which sews; a hunting dog may be a dog for hunting and a dog that hunts.