```coffeescript
String::score = (abbreviation) ->
  string = @

  return 1 if string == abbreviation

  index = string.indexOf(abbreviation)

  # only allow substrings to match
  return 0 if index == -1

  return 1 if index == 0

  abbreviation.length / string.length

```

Update string scoring to be case insensitive
user
```coffeescript
String::score = (abbreviation) ->
  string = @toLowerCase()
  abbreviation = abbreviation.toLowerCase()

  return 1 if string == abbreviation

  index = string.indexOf(abbreviation)

  # only allow substrings to match
  return 0 if index == -1

  return 1 if index == 0

  abbreviation.length / string.length

```
assistant