Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link count inaccurate in Editor->Story->Details #1465

Open
3 of 4 tasks
rafaelfajardo opened this issue Nov 10, 2023 · 2 comments
Open
3 of 4 tasks

Link count inaccurate in Editor->Story->Details #1465

rafaelfajardo opened this issue Nov 10, 2023 · 2 comments
Labels
bug Something isn't working P3 (could) Annoying bugs that have workarounds, Interesting ideas

Comments

@rafaelfajardo
Copy link

Describe the bug.

The link count report in the Details window of the Story menu in the Twine Story Editor returns inaccurate numbers. It appears to not count two-way links. It appears to undercount total links. I have encountered this in v2.7.1, both on the MacOS Desktop and the web-browser version. I have duplicated this undercounting in a classroom setting with a variety of Windows and MacOS laptops. The link count is a useful analytical tool of lexical complexity.

Steps to reproduce:

We have seen this in a variety of different stories. My test story was formed by creating a succession of passages with numerals for titles and linking them as I typed. For example passage "1" contains [[2]] [[3]]; passage "2" contains [[3]] [[4]]; and so on. I built a story with 16 passages and 32 links, two from each passage, one way. The link count returned 16 when there were 32 links.

Expected behavior:

The link count would optimally return the number of links accurately. I would welcome defining a link that is visually represented with a line with arrows on each end as two links, one in each direction. I would expect a link visually represented with a single arrowhead as one link.

Additional context on this problem.

The link count is a useful analytical tool of lexical complexity.

Twine version number

2.7.1

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

macOS

If this problem is occurring with the web version of Twine, what browser does it occur on?

Safari

Presubmission checklist

  • I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
  • I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
  • If this problem is occurring with the app version of Twine, it still happens after I remove the user.css file from my Twine folder. (You would've added this file yourself. If you don't understand this question, you can safely check this box.)
  • I have read and agree to abide by this project's Code of Conduct.
@rafaelfajardo rafaelfajardo added the bug Something isn't working label Nov 10, 2023
@klembot
Copy link
Owner

klembot commented Nov 12, 2023

The algorithm is here. I think the inaccuracy you're seeing is that it counts unique links; e.g. if you create a passage with text [[1]] [[1]] [[1]], it reports 1 link, not 3, and if you have a second passage that contains [[1]], it still reports 1, not 2. In my testing today, it does count two-way links as 2 distinct links.

I think there's an argument that the link count should reflect how many link arrows there are in the map, but I'm not sure if you'd agree based on your description. e.g. how many links do you feel the example below has?

Screenshot 2023-11-12 at 2 37 23 PM

@klembot klembot added the P3 (could) Annoying bugs that have workarounds, Interesting ideas label Nov 12, 2023
@hituro
Copy link

hituro commented Jan 17, 2024

I can see arguments for that being either 2 or 4 links, but definitely not 1.

The argument against it being 4, is that it's not possible to distinguish the following two cases (using Sugarcube, but any story format presents the same issue)

* [[Go left|1]
* [[Go right|1]]
* [[Go up|1]]
<<if $metBoss>>
   [[Say hi to Greg|1]]
<</else>>
   [[Greet your new boss|1]]
<</if>>

The first example presents 3 links to the reader, which all happen to go to the same passage. The second example only ever presents 1 link to the reader. As a measure of complexity, these two are quite different.

Perhaps the count should show "all links" (which would be 4 here) and "unique links" (which would be 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 (could) Annoying bugs that have workarounds, Interesting ideas
Projects
None yet
Development

No branches or pull requests

3 participants