A new method for testing linguistic similarity