public static String shortDocumentation(String documentation) {
    { int lineend = Stella.NULL_INTEGER;
      int sentenceend = Stella.NULL_INTEGER;

      if (documentation == null) {
        documentation = "Not documented.";
      }
      lineend = Native.string_position(documentation, '\r', 0);
      if (lineend == Stella.NULL_INTEGER) {
        lineend = Native.string_position(documentation, '\n', 0);
      }
      if (lineend == Stella.NULL_INTEGER) {
        return (documentation);
      }
      if (Native.string_memberP(".!", documentation.charAt((lineend - 1)))) {
        return (Native.string_subsequence(documentation, 0, lineend));
      }
      sentenceend = Native.string_position(documentation, '.', 0);
      if ((sentenceend != Stella.NULL_INTEGER) &&
          (sentenceend <= 155)) {
        return (Native.string_subsequence(documentation, 0, sentenceend + 1));
      }
      else {
        return (Native.string_subsequence(documentation, 0, lineend));
      }
    }
  }