diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/PastParticipleTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/PastParticipleTest.java index 92384641c831..6531038a2457 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/PastParticipleTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/PastParticipleTest.java @@ -115,6 +115,7 @@ public class PastParticipleTest { assertEquals("matches", pastParticiple("matches")); assertEquals("equals", pastParticiple("equals")); assertEquals("of", pastParticiple("of")); - //assertEquals("running", generatePastParticiple("running")); + assertEquals("проблем", pastParticiple("проблем")); + assertEquals("string1", pastParticiple("string1")); } } \ No newline at end of file diff --git a/platform/util/src/com/intellij/openapi/util/text/PastParticiple.java b/platform/util/src/com/intellij/openapi/util/text/PastParticiple.java index bc9523828d71..ed7f6c9f7782 100644 --- a/platform/util/src/com/intellij/openapi/util/text/PastParticiple.java +++ b/platform/util/src/com/intellij/openapi/util/text/PastParticiple.java @@ -105,9 +105,16 @@ public class PastParticiple { char c1 = toLowerCase(verb.charAt(length - 1)); char c2 = toLowerCase(verb.charAt(length - 2)); if (c1 == 's' && (c2 == 'e' || c2 == 'l')) return true; + for (int i = 0; i < length; i++) { + if (!isAsciiLetter(verb.charAt(i))) return true; + } return false; } - + + private static boolean isAsciiLetter(char c) { + return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; + } + private static char toLowerCase(char c) { return (char)(c | 0x20); // cheap hack }