SMS: Measuring segregation: basic concepts and extensions to other domains