<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>421612</bug_id>
          
          <creation_ts>2020-05-16 12:15:52 +0000</creation_ts>
          <short_desc>When formatting IDs, removed „small words” still get counted, leading to unexpected results</short_desc>
          <delta_ts>2020-07-07 18:06:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>KBibTeX</product>
          <component>User interface</component>
          <version>0.9.2</version>
          <rep_platform>Manjaro</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="nobodyinperson">nobodyinperson</reporter>
          <assigned_to name="Thomas Fischer">fischer</assigned_to>
          
          
          <cf_commitlink>https://invent.kde.org/office/kbibtex/commit/5a35c183a3ed6c5a604aac2f1943db2ecfcf772d</cf_commitlink>
          <cf_versionfixedin>0.10</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1930285</commentid>
    <comment_count>0</comment_count>
      <attachid>128510</attachid>
    <who name="nobodyinperson">nobodyinperson</who>
    <bug_when>2020-05-16 12:15:52 +0000</bug_when>
    <thetext>Created attachment 128510
could-be-fix for id title word counting

SUMMARY

KBibTeX can automatically format the IDs, a very handy feature. The possibility to define custom formats is also very useful. However, when removing „small words” (e.g. in the title), these removed words still get counted, leading to an unexpected and non-constant amount of words in the final id.

STEPS TO REPRODUCE
1. Add a new ID formatting scheme
2. As only field choose &quot;Title&quot;
3. Choose &quot;First Word&quot; to &quot;Third Word&quot;
4. Enable removing small words
5. Format an entry with title &quot;The very important Title&quot;

(even worse if choosing only &quot;First Word&quot; to &quot;First Word&quot; if one wants the first sensible word of the title)

OBSERVED RESULT

Id is formatted as &quot;veryimportant&quot;

(Id is formatted as empty string &quot;&quot;)

EXPECTED RESULT

Id should be formatted as &quot;veryimportanttitle&quot;

(Id should be formatted as &quot;very&quot;)


SOFTWARE/OS VERSIONS

up-to-date Manjaro with KBibTex 0.9.2 from the official repositories

ADDITIONAL INFORMATION

I couldn&apos;t compile it myself on the quick, but something along the lines in the attachment should result in the desired behaviour (only increasing the word count when a word was really appended), at least for the title.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1930395</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Fischer">fischer</who>
    <bug_when>2020-05-16 20:56:09 +0000</bug_when>
    <thetext>I can confirm this problem and I think I have may have fixed it, but I cannot push it due to maintenance on KDE&apos;s Git servers. Will try again in a few days and then you can test and confirm if this problem has been fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1940943</commentid>
    <comment_count>2</comment_count>
    <who name="nobodyinperson">nobodyinperson</who>
    <bug_when>2020-07-01 05:20:48 +0000</bug_when>
    <thetext>Thanks for your work!

It seems KDE&apos;s migration to https://invent.gitlab.org is now officially live: https://dot.kde.org/2020/06/30/kdes-gitlab-now-live

Are you now able to push?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942204</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Fischer">fischer</who>
    <bug_when>2020-07-07 11:11:32 +0000</bug_when>
    <thetext>Ok, I pushed a potential fix to my personal clone of KBibTeX&apos;s Git repository:
https://invent.kde.org/thomasfischer/kbibtex/commit/5a35c183a3ed6c5a604aac2f1943db2ecfcf772d

To test the code:
0. Uninstall the distribution-provided KBibTeX installation (not sure if actually necessary; try if problems in following steps arise)
1. Get this script:  https://invent.kde.org/thomasfischer/kbibtex-related/-/raw/master/run/run-kbibtex.sh?inline=false
2. Run as:   bash run-kbibtex.sh https://invent.kde.org/thomasfischer/kbibtex.git bugs/kde421612

I hope all paths are set correctly after the migration to invent.kde.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942211</commentid>
    <comment_count>4</comment_count>
    <who name="nobodyinperson">nobodyinperson</who>
    <bug_when>2020-07-07 12:17:50 +0000</bug_when>
    <thetext>It seems to work. I had to install a couple of dependencies unter Manjaro (qt5-networkauth, kdoctools and kate) to make it build. When run, the fonts look really ugly, but everything works. Small words are now not counted anymore, thanks.

Personally, I&apos;d prefer all non-word-characters (dashes, etc...) being word separators, not only whitespace. But I guess that&apos;s another issue...

BTW, should one now post issues on GitLab? Or still here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942261</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Fischer">fischer</who>
    <bug_when>2020-07-07 18:03:41 +0000</bug_when>
    <thetext>(In reply to nobodyinperson from comment #4)
&gt; It seems to work. I had to install a couple of dependencies unter Manjaro
&gt; (qt5-networkauth, kdoctools and kate) to make it build.
That is to be expected.

&gt; When run, the fonts ok really ugly, but everything works.
Icons are likely not loading, either. Mostly a visual issue, the KBibTeX should still work, as you report.

&gt; Small words are now not counted anymore, thanks.
Good. Then I will apply the patch for real.

&gt; Personally, I&apos;d prefer all non-word-characters (dashes, etc...) being word
&gt; separators, not only whitespace. But I guess that&apos;s another issue...
Indeed. Please open a new issue about this. As I am not sure what you mean here, please provide some examples in your new report.

&gt; BTW, should one now post issues on GitLab? Or still here?
AFAIK, bugs.kde.org is still the primary place to report bugs and request features. For example, at
 https://community.kde.org/Infrastructure/GitLab
is says:
&quot;The KDE community does not generally use GitLab for bug reporting. Please continue to submit bug reports on https://bugs.kde.org.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942262</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Fischer">fischer</who>
    <bug_when>2020-07-07 18:03:58 +0000</bug_when>
    <thetext>Git commit 5a35c183a3ed6c5a604aac2f1943db2ecfcf772d by Thomas Fischer.
Committed on 07/07/2020 at 10:14.
Pushed by thomasfischer into branch &apos;kbibtex/0.10&apos;.

When suggesting entry ids, do not count &apos;small words&apos;

When generating entry ids based on title or journal title, a range of
words, such as from first to fourth word can be specified.
Before this commit, &apos;small words&apos;, despite being removed in the id
generation process, were counted when determining the first, second, ...
word.
If the suggestion template stated &apos;first word only&apos; and the first word
was a &apos;small word&apos; such as &apos;the&apos;, an empty suggestion may have been
generated.

M  +1    -0    ChangeLog
M  +3    -2    src/processing/idsuggestions.cpp

https://invent.kde.org/office/kbibtex/commit/5a35c183a3ed6c5a604aac2f1943db2ecfcf772d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942263</commentid>
    <comment_count>7</comment_count>
    <who name="Thomas Fischer">fischer</who>
    <bug_when>2020-07-07 18:06:00 +0000</bug_when>
    <thetext>Git commit 8c4212e4d00ba92f4d9aeebe35cd5393702c2c05 by Thomas Fischer.
Committed on 07/07/2020 at 18:00.
Pushed by thomasfischer into branch &apos;master&apos;.

When suggesting entry ids, do not count &apos;small words&apos;

When generating entry ids based on title or journal title, a range of
words, such as from first to fourth word can be specified.
Before this commit, &apos;small words&apos;, despite being removed in the id
generation process, were counted when determining the first, second, ...
word.
If the suggestion template stated &apos;first word only&apos; and the first word
was a &apos;small word&apos; such as &apos;the&apos;, an empty suggestion may have been
generated.

Forward-port of commit 5a35c183a3ed6c5a604aa from branch &apos;kbibtex/0.10&apos;.

M  +1    -0    ChangeLog
M  +3    -2    src/processing/idsuggestions.cpp

https://invent.kde.org/office/kbibtex/commit/8c4212e4d00ba92f4d9aeebe35cd5393702c2c05</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>128510</attachid>
            <date>2020-05-16 12:15:52 +0000</date>
            <delta_ts>2020-05-16 12:15:52 +0000</delta_ts>
            <desc>could-be-fix for id title word counting</desc>
            <filename>file_421612.txt</filename>
            <type>text/plain</type>
            <size>1134</size>
            <attacher name="nobodyinperson">nobodyinperson</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL3NyYy9wcm9jZXNzaW5nL2lkc3VnZ2VzdGlvbnMuY3BwIGIvc3JjL3Byb2Nl
c3NpbmcvaWRzdWdnZXN0aW9ucy5jcHANCmluZGV4IDc1OTVhZTYwLi40ODk4OGM3MyAxMDA2NDQN
Ci0tLSBhL3NyYy9wcm9jZXNzaW5nL2lkc3VnZ2VzdGlvbnMuY3BwDQorKysgYi9zcmMvcHJvY2Vz
c2luZy9pZHN1Z2dlc3Rpb25zLmNwcA0KQEAgLTY5LDcgKzY5LDcgQEAgcHVibGljOg0KICAgICAg
ICAgc3RhdGljIGNvbnN0IFFSZWd1bGFyRXhwcmVzc2lvbiBzZXF1ZW5jZU9mU3BhY2VzKFFTdHJp
bmdMaXRlcmFsKCJcXHMrIikpOw0KICAgICAgICAgY29uc3QgUVN0cmluZ0xpc3QgdGl0bGVXb3Jk
cyA9IFBsYWluVGV4dFZhbHVlOjp0ZXh0KGVudHJ5LnZhbHVlKEVudHJ5OjpmdFRpdGxlKSkuc3Bs
aXQoc2VxdWVuY2VPZlNwYWNlcywgUVN0cmluZzo6U2tpcEVtcHR5UGFydHMpOw0KICAgICAgICAg
aW50IGluZGV4ID0gMDsNCi0gICAgICAgIGZvciAoUVN0cmluZ0xpc3Q6OkNvbnN0SXRlcmF0b3Ig
aXQgPSB0aXRsZVdvcmRzLmJlZ2luKCk7IGl0ICE9IHRpdGxlV29yZHMuZW5kKCk7ICsraXQsICsr
aW5kZXgpIHsNCisgICAgICAgIGZvciAoUVN0cmluZ0xpc3Q6OkNvbnN0SXRlcmF0b3IgaXQgPSB0
aXRsZVdvcmRzLmJlZ2luKCk7IGl0ICE9IHRpdGxlV29yZHMuZW5kKCk7ICsraXQpIHsNCiAgICAg
ICAgICAgICBjb25zdCBRU3RyaW5nIGxvd2VyVGV4dCA9IG5vcm1hbGl6ZVRleHQoKml0KS50b0xv
d2VyKCk7DQogICAgICAgICAgICAgaWYgKChyZW1vdmVTbWFsbFdvcmRzICYmIHNtYWxsV29yZHMu
Y29udGFpbnMobG93ZXJUZXh0KSkgfHwgaW5kZXggPCB0dGkuc3RhcnRXb3JkIHx8IGluZGV4ID4g
dHRpLmVuZFdvcmQpDQogICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KQEAgLTg0LDYgKzg0LDcg
QEAgcHVibGljOg0KICAgICAgICAgICAgICAgICB0aXRsZUNvbXBvbmVudCA9IHRpdGxlQ29tcG9u
ZW50WzBdLnRvVXBwZXIoKSArIHRpdGxlQ29tcG9uZW50Lm1pZCgxKTsNCiANCiAgICAgICAgICAg
ICByZXN1bHQuYXBwZW5kKHRpdGxlQ29tcG9uZW50KTsNCisgICAgICAgICAgICBpbmRleCsrOw0K
ICAgICAgICAgfQ0KIA0KICAgICAgICAgc3dpdGNoICh0dGkuY2FzZUNoYW5nZSkgew0K
</data>

          </attachment>
      

    </bug>

</bugzilla>