Hello. There is a text my program divides it into sentences. But because of possible references, it will not divide the text into sentences correctly. I find the points on the loop and charAt also do with !!! ... And by the way.

As far as I understand, I need to find possible www. http https .ru .... How can I find all the links in a line and find out their location so that when I searched for points and other signs did not get on this link?

  • I think it should work if you set the check for a space after the point. And links are all sorts of wap.click , for example. - Real KEK
  • Links in subtitles) - Dmitry Berezhnoy

1 answer 1

References, as far as I know, do not contain spaces. You can use this property and find all the points that are near them. These will obviously be points not included in the url.
This method can not provide accurate division into sentences, but at least, it will eliminate false positives on the links.

 String text = "Насколько я понял мне нужно найти возможные" + " www. http https .ru .... Как мне найти все ссылки в " + "строке и узнать их местоположение что бы" + " http://www.yandex.ru/" + " когда я искал точки и другие знаки не попал на эту ссылку?"; for (String str : text.split("([\\s][.])|([.][\\s])")) System.out.println(str); 

The output will be:

As far as I understand, I need to find possible www
http https
ru
..
How can I find all the links in the line and find out their location so that http://www.yandex.ru/ when I searched for points and other signs did not get on this link?

  • Good idea, it is just necessary still on everyones! ? ; ... ??? !!! Check ... um ... - Dmitry Berezhnoy
  • I’d just find out the location, I would put its coordinates in arrays and when the cycle was spinning, I would reject unnecessary intervals. - Dmitry Berezhnoy
  • In my chapter it’s just while spinning something with a cycle and a lot - Dmitry Berezhnoy
  • @ Dmitriy Berezhnoy, we can supplement the regular schedule for the necessary characters - Artem Konovalov
  • I’m just not familiar with the regular one)))) I’ll learn then)) otherwise my 200-line method may be easier for me - Dmitry Berezhnoy