Local context-based recognition of sketched diagrams