Alternation of walking pattern decreases quality of life and may result in falls and injuries. Freezing of gait (FOG) in Parkinson's disease (PD) patients occurs occasionally and intermittently, appearing in a random, inexplicable manner. In order to detect typical disturbances during walking, we designed an expert system for automatic classification of various gait patterns. The proposed method is based on processing of data obtained from an inertial sensor mounted on shank. The algorithm separates normal from abnormal gait using Pearson's correlation and describes each stride by duration, shank displacement, and spectral components. A rule-based data processing classifies strides as normal, short (short(+)) or very short (short(-)) strides, FOG with tremor (FOG(+)) or FOG with complete motor block (FOG(-)). The algorithm also distinguishes between straight and turning strides. In 12 PD patients, FOG(+) and FOG(-) were identified correctly in 100% of strides, while normal strides were recognized in 95% of cases. Short(+) and short(-) strides were identified in about 84% and 78%. Turning strides were correctly identified in 88% of cases. The proposed method may be used as an expert system for detailed stride classification, providing warning for severe FOG episodes and near-fall situations.